You are here: Re: automatic logout before SESSION end « PHP Programming Language « IT news, forums, messages
Re: automatic logout before SESSION end

Posted by Gordon Burditt on 10/21/05 00:48

>On my site people have to log in and automatically start a session. An
>authorized login grants access to other pages and MySQL data.
>However when the user waits to long,
>the server ends the session,

*WHICH* server ends the *WHAT KIND OF* session? I presume you mean
MySQL server and the connection to it, not http server and PHP
$_SESSION, here.

>without a
>proper logout. The user can't see that he is logged out, hits a button and
>gets
>mutiple errors because MySQL is no longer available.

I'd like to suggest re-establishing the MySQL connection, if possible,
if it has timed out. Then there's no need to warn the user.

>Is there a way to to warn the user a minute before the session is ended?

PHP runs server side. You can't push data to the browser. You could
tell the user his session has timed out, but it's a little late at
that point. Javascript is Turned Off(tm).

>I just read, the session time is set in session.gc_maxlifetime in php.ini.

The maximum idle time for a MySQL connection is set in my.cnf or
a server default.

Gordon L. Burditt

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация