Session handling in ASP.Net 2.0

Discussion in 'Software' started by rammca, Oct 25, 2006.

  1. rammca

    rammca

    Joined:
    Oct 25, 2006
    Messages:
    1
    Likes Received:
    0
    Hi All,

    I am a new member. I am working in an ASP.Net 2.0 project. I need to keep track of user sessions in the database. ie. I have a table called users which consists of the following fields : Username, Password, IsLoggedIn, LastLoggedIn, LastLoggedOut.

    When a user logs in , I'll update the IsLoggedIn field to 1 and LastLoggedIn fields and similarlly when the user logs out , I'll update the IsLoggedIn field to 0 and LastLoggedOut fields. The thing is it works fine. But if the user closes the browser or visits some other web site , instead of logging out , I couldn't update the table. I tried by writing code in Session_On_End event but it fires only when the person logs out or the session expires.

    How to do this?. Please throw some light on the same.

    Thanks in advance. Waiting for u'r responses.

    Regards,
    S.Ramalingam
     
    rammca, Oct 25, 2006
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.