473,396 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2418
..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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David B | last post by:
Hi, Could somebody please tell me how I check whether a session is dead based soley on the Session.SessionID. At present the timeout is set to 20 minutes in IIS, I am aware that I can reset...
6
by: Keith | last post by:
Is there any way of detecting whether a session variable does not exist because it expired or because it simply did not exist in the first place? Thanks
0
by: Thotatri | last post by:
hi, I am facing a session time out problem once after installing .net framework 1.1 . The problem is session is getting expired on frequently say 5 mts like that.I have good configuration &...
3
by: Simon | last post by:
Hi all, Any help with this would be much appreciated: I have a site where the session needs to timeout because of security concerns. I want to send the user back to the login page if the...
1
by: Bharath | last post by:
Hi All, I'm embedding a windows user control in aspx page and showing the user control in the IE, the problem that I'm facing is that the user session of the parent application is getting expired...
3
by: rsouza | last post by:
Hi. Recently here in my work we added the following code in the Global.asax file to handled the session expired and redirect users to the home of the site explaining them the occurred (some...
2
by: rsouza | last post by:
Hi. Recently here in my work we added the following code in the Global.asax file to handled the session expired and redirect users to the home of the site explaining them the occurred (some...
2
by: Gordon Burditt | last post by:
I had this idea about preventing session fixation, and I'm wondering what anyone else thinks about it. The idea is, essentially, don't allow session ids that YOUR PHP didn't generate (and aren't...
7
by: Microsoft Newsserver | last post by:
Hi Folks. I have an issue I need some help with if thats OK. I am running Framework 2.0 using Windows Integrated Security. For most of the application we manage session timeouts without the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.