Jump to content

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"

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.