Re: Session timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can simulate that, because not always you'll be able to do "init_set"

You can save in a session var the TTL (time to live)
$_SESSION['TTL'] = time() + TIMEOUT;

Then before do anything you see if the session is still valid
if ( $_SESSION['TTL'] <  time() )  close_session();


I hope this be helpful for you!

On 13/12/2007, Richard Heyes <richardh@xxxxxxxxxxx> wrote:
>
> > I've read a bit about PHP session timeout. Is it configurable?? I mean,
> > If i want user logged out after 10 minutes of innactivity... where i can
> > to set it up?? Is it possible to expire session configuring php.ini.
> > I know i will have to write code to do whatever when the session
> expires...
>
> There are various configuration options for this (which you change in
> the php.ini or by using the ini_set() function):
>
> session.gc_maxlifetime
> session.cookie_lifetime
>
> Read all about sessions here:
>
> http://uk.php.net/manual/en/ref.session.php
>
> --
> Richard Heyes
> http://www.websupportsolutions.co.uk
>
> Knowledge Base and HelpDesk software
> that can cut the cost of online support
>
> ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Best Regards

Cesar D. Rodas
http://www.cesarodas.com
http://www.thyphp.com
http://www.phpajax.org
Phone: +595-961-974165

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux