session - PHP: Remember Me, Stay logged in doesn't work -


In my PHP project, I have a user remember me checkbox So that everyone can stay logged in:

So far I log in to my general:

  public function login user ($ psmail, $ pspwd, $ PnRememberMe = 0 ) {// Check credentials and so on // if matches mail and password (credential OKAY) {$ _SESSION ["user name"] = "afu"; $ LnExpire = Time () + 3600 * 24 * 60; Setuqi ("remember", base 64_AD (USERID), $ lnExpire); SetuKi ("Remembrance Token", MD5 (SOMESTUFF), $ LNXEsire); }}  

When I log in, I can see the cookie variations created with them:

  print_r ($ _ cookie);  

Now I try to leave the site with my logout function:

  // session variable $ $ _SESSION = array (); // Delete session session_destroy ();  

But now, when I am on the landing page, does my cookies go too? Could this be due to my session site settings?

  ini_set ("session.use_only_cookies", "1"); Ini_set ("session.use_trans_sid", "0");  

php function is the fourth logic path of setcookie, from the documentation "the path on the server Cookie will be available ". By default this sets your directory in real way. Set "/" then it will be available for all domains.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -