You must Sign In to post a response.
  • Category: ASP.NET

    Track user login and logout timings in and save to database

    i am having an admin panel who can see the users login and logout timings...
    my requirement is how to design table and how to save loin and logout time every time user logs in and logs out into application and how can if same user logs in two or three times a days how can we save his details as i cannot create seperate tables for every user.
  • #769226
    Hi,

    This can be easily done in the .NET based application.
    In .NET architecture all the application can have unique ID and Session_Start function.
    So you need to implement your table logic in the Session_Start and Session_end functionality with login and logout.

    In Session_Start, store the session ID along with user ID and system date. So every time when the user logs in we can validate the user with these 3 parameters. So if he logs in more than thrice then we can show the message to the user that you have logged in 3 times.

    Thanks,
    Mani

  • #769228
    create separate table with two columns like logintime and logout time with sessionids
    a) while login insert the logintime
    b) while logout update the samerow based on sessionid's

    should probably handle
    1. while logout need to regenerate the sessionids
    2. idle session timeout should be handle.
    3. Force browser closing should be handle.

    hope this help!

    thnx
    Muhil

  • #769229
    Thanks Manigandan and MuhiReks. i have done the same way muhireks has suggested. during logout i should regenerate or get the session id?? and after doing logout should i remove sessions ????? like session.abandon or seesion.removeAll()...

  • #769230
    create separate table with two columns like logintime and logout time with sessionids
    a) while login insert the logintime
    b) while logout update the samerow based on sessionid's

    should probably handle
    1. while logout need to regenerate the sessionids
    2. idle session timeout should be handle.
    3. Force browser closing should be handle.

    hope this help!

    thnx
    Muhil


  • Sign In to post your comments