Detail of my problem

Results 1 to 2 of 2

Thread: Detail of my problem

  1. #1
    Join Date
    Dec 1969

    Default Detail of my problem

    Hi bill I just want to know that the redirection is working fine means when session timesout and when user clik on any link it will redirect him to the login page. ok <BR>but in my application i m getting the user loing and logout time and storing it in the data base when the user log out from the link which i have given in my application it will get the session user ID , Its logout time, and also update the login field in the database to "No" so that he can login again. and when the user login i have made a check if in the database that particular user login field="Yes" then he can not login so when he logs out that field become no and he can login again from my logout button it is working fine I need to do the same thing when session.timeout=8 and also when the user closes his browser directly could you help me in this regard. <BR><BR>Thanks <BR>Atif ur Rahim

  2. #2
    Join Date
    Dec 1969

    Default I don't know how to help you more...

    I&#039;ve given you every answer I can think of.<BR><BR>I told you that you could use &#060;BODY OnUnload=...&#062; to *TRY* to do the logout. But I warned you that this MAY NOT WORK depending on the user&#039;s browser settings.<BR><BR>Maybe the only thing I did not mention was that you could use<BR> Sub Session_OnEnd( )<BR>in your global.asa file to force the logout. But fair warning: Session_OnEnd is notoriously unreliable.<BR><BR>I tell you what I would do: <BR><BR>(1) Change your login field in the DB to a DATETIME field. *ALSO* add a SessionID field to the table.<BR><BR>(2) When a person logs in, store the current date and time in login and the session id in SessionID:<BR> Access:<BR> SQL = "UPDATE usersTable SET login = Now( ), SessionID = " & Session.SessionID _<BR> & " WHERE [userID] = " & currentUserID<BR> SQL Server:<BR> SQL = "UPDATE usersTable SET login = GetDate( ), SessionID = " & Session.SessionID _<BR> & " WHERE [userID] = " & currentUserID<BR><BR>(3) When a person logs out, store a NULL in that field:<BR> SQL = "UPDATE usersTable SET login = NULL, SessionID = NULL " _<BR> & " WHERE [userID] = " & currentUserID<BR><BR>(4) If a person tries to login again when the login field is *NOT* null *AND* the SessionID field does *NOT* match the current Session.SessionID, then do the following:<BR><BR> (4-A) If the login field date/time is more than some number of minutes in the past (10 minutes? 20? an hour?), then just ignore the value in that field and allow the login.<BR><BR> (4-B) If the login is very recent, then tell the user he/she is already logged in on another session and give him/her the option of dropping THAT session and using this one, instead.<BR><BR>***********<BR><BR>This is my advice, but you are free to do whatever you want to do.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts