Jump to content

Sessions


lalnfl

Recommended Posts

http://php.net/manual/en/function.session-set-cookie-params.php

 

Set cookie parameters defined in the php.ini file. The effect of this function only lasts for the duration of the script. Thus, you need to call session_set_cookie_params() for every request and before session_start() is called.

 

this sounds like an interesting way to increase session life time. have you tried altering php.ini and/or .htaccess and/or using ini_set()?

 

http://www.google.com/search?client=safari&rls=en&q=php+session+lifetime&ie=UTF-8&oe=UTF-8

Link to comment
https://forums.phpfreaks.com/topic/225026-sessions/#findComment-1162349
Share on other sites

A session consists of two parts, the session id cookie from the browser and the corresponding session data file on the server.

 

The first parameter in session_set_cookie_params() ONLY sets the session cookie lifetime, which only means that the cookie will last for that amount of time AFTER you close the browser. This has nothing to do with the problem of the session ending while the browser is still open. A zero session cookie lifetime means that the cookie is deleted when the browser is closed.

 

Your session data files are being deleted on the server. If you do a search on the forum, using my username and the search term session.gc_maxlifetime you will find numerous discussions about making a session last longer when there is no activity from the browser.

 

 

Link to comment
https://forums.phpfreaks.com/topic/225026-sessions/#findComment-1162355
Share on other sites

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.