Page 1 of 1

Session expiration

Posted: Wed Jan 21, 2004 4:40 am
by mzfp2
Hi

is it possible to define a fixed time for which a session will stay active for? At the moment my sessions expire too frequently and is annoying users a bit !

Thanks

Posted: Wed Jan 21, 2004 5:52 am
by DuFF
It may be the session.cache_expire setting in your PHP.ini (it defaults to 180), so try changing that. If you don't have access to the PHP.ini you can use:

Code: Select all

<?php
session_cache_expire(180);
?>
At the top of every page, before session_start(), to set the cache expire for 180 minutes.