Logging DateTime in SQL Table When Users Session Ends

codeBoy

I have written an application and with this application the user has to login. I have a table where I am keeping their login token for that session, datetime they logged in, datetime they logged out and the duration in which they were logged in.

This functionality works great when the user actually goes and clicks Logout. If the user does not click Logout, then it will not take the datetime for the logout and it won't give me the duration.

Some users are just simply exiting out without clicking logout basically, is there a way to fire an event I guess when the session ends to capture the logout information?

Right now I just have an insert statement wired up to my login button and update statement wired up to my logout button.

Kevin

In Global.asax.cs is an event handler

    protected void Session_End(object sender, EventArgs e)
    {

    }

Which should get fired on session end.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Clearing sessions in django_session table without logging out current users

From Dev

Is class instrumentation removed when profiling session ends?

From Dev

MVC 4 Redirect when session ends

From Dev

Is class instrumentation removed when profiling session ends?

From Dev

Change Rails session cookie domain without logging users out

From Dev

Ending session when Logging out in JSP

From Dev

Laravel 4.2 ends session when spamming ajax post

From Dev

Save datetime in sql table

From Dev

Save datetime in sql table

From Dev

How to detect when users are logout with Session timeout?

From Dev

using wp_authenticate() to redirect certain users when logging in

From Dev

How to disable the sound when logging off / locking / switching users?

From Dev

Logging rows that are deleted in a table sql server

From Dev

is there a way to keep a session alive even when logging out?

From Dev

Problems with sending DateTime to SQL Table

From Dev

SQL-Select ends up in an Error when combined

From Dev

SQL-Select ends up in an Error when combined

From Dev

Authentication not works when users are stored in alternative table

From Dev

SQL Table structure for storing daily activities of users

From Dev

SQL Server : are transaction locking table for other users?

From Dev

Get users current page when session times out

From Dev

Exception when logging in with Simple Facebook API (Session: an attempt was made to open a session that has a pending request)

From Dev

update table when finish session login in php

From Dev

Saving the PuTTY session logging

From Dev

Logging into an RDP/S session

From Dev

PHP session in logging in

From Dev

Saving the PuTTY session logging

From Dev

Server logging with session metadata

From Dev

Session is not abandoned on logging out

Related Related

  1. 1

    Clearing sessions in django_session table without logging out current users

  2. 2

    Is class instrumentation removed when profiling session ends?

  3. 3

    MVC 4 Redirect when session ends

  4. 4

    Is class instrumentation removed when profiling session ends?

  5. 5

    Change Rails session cookie domain without logging users out

  6. 6

    Ending session when Logging out in JSP

  7. 7

    Laravel 4.2 ends session when spamming ajax post

  8. 8

    Save datetime in sql table

  9. 9

    Save datetime in sql table

  10. 10

    How to detect when users are logout with Session timeout?

  11. 11

    using wp_authenticate() to redirect certain users when logging in

  12. 12

    How to disable the sound when logging off / locking / switching users?

  13. 13

    Logging rows that are deleted in a table sql server

  14. 14

    is there a way to keep a session alive even when logging out?

  15. 15

    Problems with sending DateTime to SQL Table

  16. 16

    SQL-Select ends up in an Error when combined

  17. 17

    SQL-Select ends up in an Error when combined

  18. 18

    Authentication not works when users are stored in alternative table

  19. 19

    SQL Table structure for storing daily activities of users

  20. 20

    SQL Server : are transaction locking table for other users?

  21. 21

    Get users current page when session times out

  22. 22

    Exception when logging in with Simple Facebook API (Session: an attempt was made to open a session that has a pending request)

  23. 23

    update table when finish session login in php

  24. 24

    Saving the PuTTY session logging

  25. 25

    Logging into an RDP/S session

  26. 26

    PHP session in logging in

  27. 27

    Saving the PuTTY session logging

  28. 28

    Server logging with session metadata

  29. 29

    Session is not abandoned on logging out

HotTag

Archive