How Session getting expired?

This is a discussion on How Session getting expired? within the PHP Language forums, part of the PHP Programming Forums category; Hello Friends, I am new to this group so big HIIIIIIII to all :) fine i have a serious doubt about ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-06-2008
sriram
 
Posts: n/a
Default How Session getting expired?

Hello Friends,

I am new to this group so big HIIIIIIII to all :) fine i have a
serious doubt about session handling in PHP. After 20 min (default
time) session getting expired, session values are stored in a folder
as a file, fine how php finiding that particular session expired?
Because the files in session folder will not be deleted after 20 min
but one session expired...

Please explain me how this is happening? How php finds that particular
session is ideal for 20 min.

Hope this is an easy question.

Thanx in advance

Regards,
Sriram
Reply With Quote
  #2 (permalink)  
Old 05-06-2008
Michael Fesser
 
Posts: n/a
Default Re: How Session getting expired?

..oO(sriram)

>I am new to this group so big HIIIIIIII to all :) fine i have a
>serious doubt about session handling in PHP. After 20 min (default
>time) session getting expired, session values are stored in a folder
>as a file, fine how php finiding that particular session expired?
>Because the files in session folder will not be deleted after 20 min
>but one session expired...
>
>Please explain me how this is happening? How php finds that particular
>session is ideal for 20 min.


Probably by looking at the date when the file was changed. If it wasn't
changed in the last 20 minutes, the session times out. But this doesn't
mean that the file will be removed immediately. Cleaning up is done by
the garbage collector, which fires every now and then, but not on every
request for performance reasons. Its behaviour can be controlled with
some ini settings.

Micha
Reply With Quote
  #3 (permalink)  
Old 05-06-2008
Jerry Stuckle
 
Posts: n/a
Default Re: How Session getting expired?

sriram wrote:
> Hello Friends,
>
> I am new to this group so big HIIIIIIII to all :) fine i have a
> serious doubt about session handling in PHP. After 20 min (default
> time) session getting expired, session values are stored in a folder
> as a file, fine how php finiding that particular session expired?
> Because the files in session folder will not be deleted after 20 min
> but one session expired...
>
> Please explain me how this is happening? How php finds that particular
> session is ideal for 20 min.
>
> Hope this is an easy question.
>
> Thanx in advance
>
> Regards,
> Sriram
>


PHP keeps track of the session timeout internally (maybe in the session
file itself - I never looked). It does not necessarily clean up expired
session files immediately. But they should be deleted eventually.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Reply With Quote
  #4 (permalink)  
Old 05-06-2008
sriram
 
Posts: n/a
Default Re: How Session getting expired?

On May 6, 9:21 pm, Michael Fesser <neti...@gmx.de> wrote:
> .oO(sriram)
>
> >I am new to this group so big HIIIIIIII to all :) fine i have a
> >serious doubt about session handling in PHP. After 20 min (default
> >time) session getting expired, session values are stored in a folder
> >as a file, fine how php finiding that particular session expired?
> >Because the files in session folder will not be deleted after 20 min
> >but one session expired...

>
> >Please explain me how this is happening? How php finds that particular
> >session is ideal for 20 min.

>
> Probably by looking at the date when the file was changed. If it wasn't
> changed in the last 20 minutes, the session times out. But this doesn't
> mean that the file will be removed immediately. Cleaning up is done by
> the garbage collector, which fires every now and then, but not on every
> request for performance reasons. Its behaviour can be controlled with
> some ini settings.
>
> Micha


Thanx for all... I think Micha is right, i thought that either. Will
do a check on it. So Micha, as you told if a session is expired after
20 min. Without refreshing the page (bec once i refresh PHP will find
the session expired) if i just do some changes in that particular
session file by opening it in an editor, then again that particular
session becomes active right? This is what you answer means.. I will
try that and let you know....

Regards,
Sriram
Reply With Quote
  #5 (permalink)  
Old 05-06-2008
Michael Fesser
 
Posts: n/a
Default Re: How Session getting expired?

..oO(sriram)

>Thanx for all... I think Micha is right, i thought that either. Will
>do a check on it. So Micha, as you told if a session is expired after
>20 min. Without refreshing the page (bec once i refresh PHP will find
>the session expired) if i just do some changes in that particular
>session file by opening it in an editor, then again that particular
>session becomes active right?


Quite possible, I haven't tested it.

>This is what you answer means.. I will
>try that and let you know....


OK.

Micha
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:04 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0