Session Timeout

I know this has been discussed several times but I’ve not found a real cohesive explaination of how to do this best.

  1. I don’t want to rely on cookies to help with this. It needs to be straight php.
  2. I probably won’t have access to the php.ini file so manipulating that is out of the question.
  3. The main goal is not to log a user out after x minutes, but rather to keep them logged in as long as possible without losing their session variable – specifically [user-id]
  4. Basically I want to keep a session alive for at least 8 hours (full working day) but when it’s done, have it re-direct to the login screen.

Any thoughts? examples would be nice as well, though I can probably go off of ideas as well.

Thanks,
Dave

Re: Session Timeout

I have the same problem. Tried putting .htaccess with these lines as suggested in some forums but didn’t work.

php_value session.cookie_lifetime 32400
php_value session.gc_maxlifetime 32400

Any suggestions?

Thanks!

Re: Session Timeout

Ok, i think i got it.

in .htaccess file:

php_value session.gc_maxlifetime 28800 | --> 8hrs
php_value session.save_path “relative path to sc tmp folder like: /home/user/…/_lib/tmp” | --> this will save the session data in the tmp folder inside _lib

In the production environment --> Configure production environment

Temporary files directory --> same relative path given in the .htaccess.

Re: Session Timeout

What about in windows environment,
I can’t create the .htaccess file I’m using xampp
thanks

Re: Session Timeout

i tried with php.ini but its never work :frowning:
any suggestion please
thanks

Re: Session Timeout

I haven’t tested it in the windows (as i deploy the apps to the server and test it there) but maybe this will help you:

http://www.technotaste.com/blog/htaccess-xampp-and-windows/