Session_End Not Firing

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Session_End Not Firing

    Hey guys I have a user tracking setup to track users. What it does is once a
    user hits my site it sends me an email telling me some info and once a user
    clicks the logout button it sends a second email that tells me what pages
    the visited, how long they were on each page, etc. The second email is in
    the Session_End Sub and the first is in the Session_Start. Now my question
    is Why is it that the Session_End is never fired. I was forced to put the
    code to send the second email on the logout.aspx page so when they click
    logout then it sends it; THAT WORKS. But what happends when a user just
    closes the browser window or goes to another site wihtout clicking logout.
    Can someone tell me how I would fix this or why the Session_End is not being
    fired at ALL. Thanks


    Chris Sibel Guest

  2. Similar Questions and Discussions

    1. Session_Start not firing
      I'm workinbg in Visual Studio 2003. I'm experimenting with creating a session variable, and from all I can gather. the Session_Start event is not...
    2. _EditCommand not firing...
      I realize this should be simple... but I'm at my wits end. I'm new to ASP.NET (.NET in general) but have many years experience with VB6. I have a...
    3. Session lasting too long -- Session_End event firing way late !! ??
      Why are my sessions lasting so long? I have them set to 20 minute timeout in config file? The Session_End event is getting called an hour or more...
    4. Session_End never fires
      I've got an ASP.NET page with a counter subtraction routine in the Session_End method in the Global.asax.cs: protected void Session_End(Object...
    5. session_end and re-login
      Dear ASP.NET Programmers, I am using forms authentication in my web application. I would like the users to be transferred to the login page when...
  3. #2

    Default Session_End Not Firing

    The session will time out after 20 minutes of no page
    requests from the
    user.
    This default time interval is configurable in your
    web.config file.
    After the session times out the Session_End event will be
    called in your
    Global.asax file.
    You can terminate the session manually by calling
    Session.Abandon, but be
    aware this will cause the Session_End event to not be
    called. But that's
    not so bad. Just take your code from the Session_End
    event, put it in a
    separate function, then call that function from both your
    Session_End event
    and whenever you call Session.Abandon.

    Here's more details for you:
    [url]http://www.asp.net/Forums/ShowPost.aspx?[/url]
    tabindex=1&PostID=7504

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]

    >-----Original Message-----
    >Hey guys I have a user tracking setup to track users.
    What it does is once a
    >user hits my site it sends me an email telling me some
    info and once a user
    >clicks the logout button it sends a second email that
    tells me what pages
    >the visited, how long they were on each page, etc. The
    second email is in
    >the Session_End Sub and the first is in the
    Session_Start. Now my question
    >is Why is it that the Session_End is never fired. I was
    forced to put the
    >code to send the second email on the logout.aspx page so
    when they click
    >logout then it sends it; THAT WORKS. But what happends
    when a user just
    >closes the browser window or goes to another site
    wihtout clicking logout.
    >Can someone tell me how I would fix this or why the
    Session_End is not being
    >fired at ALL. Thanks
    >
    >
    >.
    >
    Steve C. Orr MCSD Guest

  4. #3

    Default Re: Session_End Not Firing

    Session_End is not a very reliable place to put this kind of code. In Logout
    page you can call Sessiob.Abandon. Then you will get the event. But if user
    simply logs out, you will never get the event untill Session times out. The
    approach you have right now, i.e. sending when LogOut button is clciked is
    the only and recommended way to get it done.

    --
    Naveen K Kohli
    [url]http://www.netomatix.com[/url]
    "Chris Sibel" <chris@dcdconsultants.com> wrote in message
    news:%23xZARIMQDHA.704@tk2msftngp13.phx.gbl...
    > Hey guys I have a user tracking setup to track users. What it does is once
    a
    > user hits my site it sends me an email telling me some info and once a
    user
    > clicks the logout button it sends a second email that tells me what pages
    > the visited, how long they were on each page, etc. The second email is in
    > the Session_End Sub and the first is in the Session_Start. Now my question
    > is Why is it that the Session_End is never fired. I was forced to put the
    > code to send the second email on the logout.aspx page so when they click
    > logout then it sends it; THAT WORKS. But what happends when a user just
    > closes the browser window or goes to another site wihtout clicking logout.
    > Can someone tell me how I would fix this or why the Session_End is not
    being
    > fired at ALL. Thanks
    >
    >

    Naveen K Kohli Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139