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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
..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 |
|
|||
|
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 ================== |
|
|||
|
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 |
|
|||
|
..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 |