A problem with session tracking
Hi, i am facing some problem while using session in my application,
The issue is when I login into my application, i set the username in a session vaiable, Now if i change my system date i.e. i increase the system date, the session is getting expired, i.e. after i increase the sysdate, and then try clicking on any of the functional tabs available in my application, i am getting redircted to the login page......
can someone plz advise on this, any solution of this problem?
thanx
# 1
Is there really a need to change the system date? I mean why are you changing the system date?
Your session is getting expired when you change the date. You must have set the session expiry time interval. When you login to your application the server reads the time. Now when the date is changed the server reads the new time and if this interval exceeds the session expiry interval then teh session expires.
Try this. Keep the session expiry for 2 hours. Login to your application. Then increase the system date-time by 1 hour. Then do some operation in the application. I bet this time you will not get the login page again.
When you increase the date-time by more than 2 hours then you will get the login page again.
# 2
hi,
i have some doubt on your comments.
you will set the session expiry intreval time for 2 hours.
if we change the time it will not redirect to login page.
if we change the both date and time, the how it's work.
on the login time, system can read the current date, after we change the date, the differs between both date is 24 hrs. i think u ll catch my doubt.
Bala
art84a at 2007-7-12 19:01:44 >

# 3
I think I did not make myself very clear.
If I set the session expiry interval for 2 hours.
Then I login to my application at 13.00 hrs 06/13/2007.
Now is I change the system time by 1 hour ie 14.00 hrs 06/13/2007.
Then do some operation in the application, then the session will not get expired.
If I change the system date, suppose I make it 14 hrs 06/14/2007 then the session will get expired as the time interval has exceeded by 25 hours to what is set viz. 2 hrs.
If I change the system time, suppose I make it 15.10 hrs 06/13/2007 then the session will get expired as the time interval has exceeded by 10 minutes to what is set viz. 2 hrs.
Bala,
you are absolutely right. the session will get expired after you change the date. I had wrote that if the time difference is increased to more that 2 hrs then the session will get expired as the session expiry interval is set to 2 hours only.