469,268 Members | 955 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,268 developers. It's quick & easy.

When/How PHP session expire? Can I set it in minutes of inactivity?

I would like to limit multiple logins for a user. How and when does
the session id expire? Can I set it so after x minutes of inactivity
it would expire. How do I check if session id exists? If I can do
these two things then I can store the session id for a user in a
database and everytime he requests an action I can just check if the
session id is active or expired. If active let him continue if
expired request to relogin. If the user tries to login and the
session id is active then reports that the id is still active and he
must either log out of the session or wait till it expires. How would
I accomplish this? Thanks

Ryan
Jul 17 '05 #1
4 39219
"Ryan Hubbard" <ry*********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
I would like to limit multiple logins for a user. How and when does
the session id expire? Can I set it so after x minutes of inactivity
it would expire.


session_cache_expire();

How do I check if session id exists?

session_is_registered();
Jul 17 '05 #2
Is session_cache_expire the number of minutes from start to end or the
number of minutes from the last activity? Thanks for your help I
can't seem to find the answer in the PHP manual.

"rostik" <ro****@tower.ntu-kpi.kiev.ua> wrote in message news:<bv**********@news.ntu-kpi.kiev.ua>...
"Ryan Hubbard" <ry*********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
I would like to limit multiple logins for a user. How and when does
the session id expire? Can I set it so after x minutes of inactivity
it would expire.


session_cache_expire();

How do I check if session id exists?

session_is_registered();

Jul 17 '05 #3
see session.gc_maxlifetime, session.cookie_lifetime in your php.ini.
If you are unable to edit it, see ini_set(); function

"Ryan Hubbard" <ry*********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
Is session_cache_expire the number of minutes from start to end or the
number of minutes from the last activity? Thanks for your help I
can't seem to find the answer in the PHP manual.

"rostik" <ro****@tower.ntu-kpi.kiev.ua> wrote in message

news:<bv**********@news.ntu-kpi.kiev.ua>...
"Ryan Hubbard" <ry*********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
I would like to limit multiple logins for a user. How and when does
the session id expire? Can I set it so after x minutes of inactivity
it would expire.


session_cache_expire();

How do I check if session id exists?

session_is_registered();

Jul 17 '05 #4
"rostik" <ro****@tower.ntu-kpi.kiev.ua> wrote in message news:<bv**********@news.ntu-kpi.kiev.ua>...
"Ryan Hubbard" <ry*********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
I would like to limit multiple logins for a user. How and when does
the session id expire? Can I set it so after x minutes of inactivity
it would expire.


session_cache_expire();

How do I check if session id exists?

session_is_registered();


Are you really helping him??

To the OP:

Manual is your friend.
<http://in.php.net/manual/en/ref.session.php> Change your INI settings
to various values and learn.

Search the archive and Google for nice login scripts.

--
"Success = 10% sweat + 90% tears"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Daniel Bengs | last post: by
5 posts views Thread by Jennifer Smith | last post: by
2 posts views Thread by brian | last post: by
1 post views Thread by caldera | last post: by
4 posts views Thread by Daniel Geisenhoff | last post: by
12 posts views Thread by ACaunter | last post: by
17 posts views Thread by jensen bredal | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.