Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 03:55 AM
Ryan Hubbard
Guest
 
Posts: n/a
Default 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



  #2  
Old July 17th, 2005, 03:55 AM
rostik
Guest
 
Posts: n/a
Default Re: When/How PHP session expire? Can I set it in minutes of inactivity?

"Ryan Hubbard" <ryanmhuconn@yahoo.com> wrote in message
news:59111545.0402031211.2b6d042c@posting.google.c om...[color=blue]
> 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.[/color]

session_cache_expire();

How do I check if session id exists?

session_is_registered();


  #3  
Old July 17th, 2005, 03:56 AM
Ryan Hubbard
Guest
 
Posts: n/a
Default Re: When/How PHP session expire? Can I set it in minutes of inactivity?

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" <rostik@tower.ntu-kpi.kiev.ua> wrote in message news:<bvp0e5$hu9$1@news.ntu-kpi.kiev.ua>...[color=blue]
> "Ryan Hubbard" <ryanmhuconn@yahoo.com> wrote in message
> news:59111545.0402031211.2b6d042c@posting.google.c om...[color=green]
> > 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.[/color]
>
> session_cache_expire();
>
> How do I check if session id exists?
>
> session_is_registered();[/color]
  #4  
Old July 17th, 2005, 03:56 AM
rostik
Guest
 
Posts: n/a
Default Re: When/How PHP session expire? Can I set it in minutes of inactivity?

see session.gc_maxlifetime, session.cookie_lifetime in your php.ini.
If you are unable to edit it, see ini_set(); function

"Ryan Hubbard" <ryanmhuconn@yahoo.com> wrote in message
news:59111545.0402040657.5029bc03@posting.google.c om...[color=blue]
> 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" <rostik@tower.ntu-kpi.kiev.ua> wrote in message[/color]
news:<bvp0e5$hu9$1@news.ntu-kpi.kiev.ua>...[color=blue][color=green]
> > "Ryan Hubbard" <ryanmhuconn@yahoo.com> wrote in message
> > news:59111545.0402031211.2b6d042c@posting.google.c om...[color=darkred]
> > > 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.[/color]
> >
> > session_cache_expire();
> >
> > How do I check if session id exists?
> >
> > session_is_registered();[/color][/color]


  #5  
Old July 17th, 2005, 03:57 AM
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
Default Re: When/How PHP session expire? Can I set it in minutes of inactivity?

"rostik" <rostik@tower.ntu-kpi.kiev.ua> wrote in message news:<bvp0e5$hu9$1@news.ntu-kpi.kiev.ua>...[color=blue]
> "Ryan Hubbard" <ryanmhuconn@yahoo.com> wrote in message
> news:59111545.0402031211.2b6d042c@posting.google.c om...[color=green]
> > 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.[/color]
>
> session_cache_expire();
>
> How do I check if session id exists?
>
> session_is_registered();[/color]

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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.