Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. What happens when the user leaves?

What happens when the user leaves?

Scheduled Pinned Locked Moved C#
csharpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sled Dog
    wrote on last edited by
    #1

    Wow 2 questions in 1 day... How do you fire off a "clean up" function if a user simply closes the browser? I have a customized cache that I would like to flush before they are gone. (This is not the built in cache object of .NET) The INPROC is set in my web.config and I have code in the Session_End portion of my Global.asax file. However, I have determined through debugging that I am hitting the Session_Start, but not the Session_End. Thank you. William

    D 1 Reply Last reply
    0
    • S Sled Dog

      Wow 2 questions in 1 day... How do you fire off a "clean up" function if a user simply closes the browser? I have a customized cache that I would like to flush before they are gone. (This is not the built in cache object of .NET) The INPROC is set in my web.config and I have code in the Session_End portion of my Global.asax file. However, I have determined through debugging that I am hitting the Session_Start, but not the Session_End. Thank you. William

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      There is no event on the server that says the user closed the browser. The only thing you can do is wait for the user's session to timeout, which, by default, I think, is 20 minutes. Then your Session_End code gets kicked off, if it's still running under the debugger. You might even catch the Session_End event being kicked off when you start your app under the debugger again. It might kick off first thing before the new Session_Start event is fired. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        There is no event on the server that says the user closed the browser. The only thing you can do is wait for the user's session to timeout, which, by default, I think, is 20 minutes. Then your Session_End code gets kicked off, if it's still running under the debugger. You might even catch the Session_End event being kicked off when you start your app under the debugger again. It might kick off first thing before the new Session_Start event is fired. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        Thanks Rage. The knowledge is helpful. BTW, 2Bad Rage is gone. Will-Keep-Listening-Anyway :-D

        D 1 Reply Last reply
        0
        • A Anonymous

          Thanks Rage. The knowledge is helpful. BTW, 2Bad Rage is gone. Will-Keep-Listening-Anyway :-D

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Nope. Rage is not gone. Rage shows up everytime I go to work... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups