php - managing user session for a website for lifetime -


I want to manage a user session for a lifetime. For example, if you are looking at a website on this website then I have registered and I have not logged out, but whenever I open this website, my username appears there again no need to login again So I want to do this for any of the sports websites. I have developed my website using php mysql flash. Can anyone guide me?

Regards, Ff.

Try setting a cookie like this:

  setkeykey ("Login cookie", $ value, time () + $ sec);  

Where $ sec is a large number like 3 years (3 * 365 * 24 * 60 * 60).

And check on your pages whether the cookie still exists:

  if (isset ($ _COOKIE ["testcookie"])) ...  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -