PDA

Click to See Complete Forum and Search --> : problem in Session End - vijay


Indian
Jul 14th, 2001, 01:28 AM
Hi!
I have a problem in our login page.Actually we won't allow more than a time ,same user to log on.
Problem goes here ......If the User log out properly thru the LogOut Link ,there will not be any Problem.If the User not properly Log out either by closing the browser/ Diconnecting from Net/PowerShutdown,problem arises.If suppose this happens,only after 20 mins(Session TimeOut),the Same User can Log on.
Can any of you help me pls.....How to Solve this Problem.

With expectations,
vijay

monte96
Jul 14th, 2001, 04:35 AM
Because the web is stateless by nature, I don't think there really is a way to handle this 100% of the time. What's more, if your using an Access database, you can't call server.MapPath from within the Session_OnEnd event so you would have to hard code the database path.

One possibility (although it is still not 100%) is to use cookies instead of writing to the database. Set the cookie to expire after a set amount of time and delete it if they log out.

You can't rely on Session_OnEnd to update your database.

chenko
Jul 14th, 2001, 08:06 AM
I dont understand your english to well,

but do you want to only allow the user to sign on once at a time, so if another user signed on with that name at the same time they would be kicked?
why not use a Application Varible in the global.asa

If its to allow the user to only sign on once every, you can enter something into the database when they login.

monte96
Jul 14th, 2001, 03:38 PM
Yes, but his problem is that if they close the browser and try to log on again, they are still logged on until the session expires. so would not be able to log in again. This is the nature of web apps. They are supposed to be stateless.