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
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
Share on other sites

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.