Zen Cart Logo
Forums / General Questions / What determines how long a PHP $_SESSION lasts, after closing browser

What determines how long a PHP $_SESSION lasts, after closing browser

Views: 831

Results 1 to 5 of 5
26 Mar 2013, 4:07 AM
#1
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

What determines how long a PHP $_SESSION lasts, after closing browser

I've noticed the PHP $_SESSION is still intact even after closing the browser window and then returning back to website. what governs how long the PHP $_SESSION lasts?,

is there something in the admin that controls this?,

26 Mar 2013, 7:23 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: What determines how long a PHP $_SESSION lasts, after closing browser

It is determined by the combination of your PHP configuration on your server and your cookie configuration in your browser.
Most PHP configurations are set to 24 minutes after the last click, and most browsers are set to correctly expire session cookies when the browser is closed, which normally trumps the PHP setting.
If you've added extra things to extend session cookies, either with browser plugins or by altering Zen Cart code or adding ZC plugins to extend cart operations, then of course all the normal things Zen Cart does are no longer valid, but are superceded by your own environment.

26 Mar 2013, 5:01 PM
#3
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

Re: What determines how long a PHP $_SESSION lasts, after closing browser

as always, thanks Dr. Byte

26 Mar 2013, 5:08 PM
#4
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

Re: What determines how long a PHP $_SESSION lasts, after closing browser

but just to be clear, ZC does not create cookies via PHP?,

when you say PHP config on the server, is that set in the ini.php file?, or can be seen via phpinfo()

thanks

26 Mar 2013, 5:12 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: What determines how long a PHP $_SESSION lasts, after closing browser

ZC works with PHP to set a session cookie. That's the only cookie that ZC sets, well out-of-the-box anyway.

When I use the phrase "PHP configuration", I mean the server's PHP configuration. That's typically done with php.ini