470,614 Members | 1,491 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

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
Jun 2 '08 #1
4 2269
..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
Jun 2 '08 #2
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.
js*******@attglobal.net
==================

Jun 2 '08 #3
On May 6, 9:21 pm, Michael Fesser <neti...@gmx.dewrote:
.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
Jun 2 '08 #4
..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
Jun 2 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by David B | last post: by
6 posts views Thread by Keith | last post: by
reply views Thread by Thotatri | last post: by
2 posts views Thread by Gordon Burditt | last post: by
7 posts views Thread by Microsoft Newsserver | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.