Jump to content

Session vars disappears?


Ifaiden

Recommended Posts

Hi! I'm working on a simple e-commerce script.  I have some $_SESSION variables that is defined and works fine while surfing on the site. But when I close the browser and reenter the site, all the session-variables are not defined (unset?), until i click on a link on the site. Weird behavior... please help!

 

/I

Link to comment
https://forums.phpfreaks.com/topic/247049-session-vars-disappears/
Share on other sites

Sessions usually only exist for as long as the user doesn't close their browser.  If you need the info to last even after a user closes the browser, you can modify how long the session cookie lives: http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime

Sessions usually only exist for as long as the user doesn't close their browser.  If you need the info to last even after a user closes the browser, you can modify how long the session cookie lives: http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime

 

From the link: "session.cookie_lifetime specifies the lifetime of the cookie in seconds which is sent to the browser. The value 0 means "until the browser is closed." Defaults to 0.". It doesn't state anything about "session stays active even after the browser has been closed"

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.