Session Events in asp.net



There are two types of session events available in
 asp.net 
  • Session_Start 
  • Session_End 
you  can handle both this event in  global.asax file of  your web application. When a new session initiatesession_start event raised and Session_End event raised when a session is abandoned or expired.

  void Session_Start(object sender, EventArgs e)
    {
        // Code that runs when a new session is started

    }

    void Session_End(object sender, EventArgs e)
    {
        // Code that runs when a session ends.

    }

2 comments:

  1. only where sessionstate mode == InProc

    ReplyDelete
  2. sessionstate mode=InProc , which stores session state in memory on the Web server. This mode is the default one.

    ReplyDelete