Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session_End Not Firing

Status
Not open for further replies.

BG12424

Programmer
Joined
Jun 4, 2002
Messages
717
Location
US
Hello,

I've done some research on the subject on this site and others and am struggling with the problem.

As link9 said in thread855-809301:
Sessions end when:
(a) there is x amount of time of inactivity in a current browser session (x is 20 minutes by default)
(b) the browser is closed
(c) Session.Abandon() is called
-------------------------------

I am having an issue when a user closes the browser in the application, session_end does not fire. I've shortened the default timeout to 1 minute so I could see immediate affects, but this event never seems to fire.

We are using Active Directory to authenticate users therefore we have impersonation turned on. Also, our session is set to be "InProc". The session timeout is set to 1 in the web.config file and in the session_start event I've also set Session.Timeout = 1.

Is there a known bug with this event or does the Session_End not run with impersonation turned on? None of the research I have done tells me that it doesn't work.

FYI, I have implemented a "Logout" function to the application, but am trying to nail down the user who just abandons the application without logging out. Thanks for everyone's help on this. If anyone has links to help areas, please feel free to share on this.

-- Brian

regards,
Brian
The problem with doing something right the first time is that nobody appreciates how difficult it was.
 
Here is a snippet of my web.config file setup:

Code:
<authentication mode="Windows" />
<identity impersonate="true" />
<authorization>
  <allow users="*" /> 
  <deny users="?" />
</authorization>
<sessionState 
  mode="InProc"
  stateConnectionString="tcpip=127.0.0.1:42424"
  sqlConnectionString="data source=127.0.0.1;userid=sa;password="
  cookieless="false" 
  timeout="1" 
/>

Here is my global.asax file Session_Start event:
Code:
    Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        Session.Timeout = 1
'I just added this for testing purpose to make sure that I have something in session, since something is required to be in session in order for the session_end to fire off.
        CType(Me.Session,SessionState.HttpSessionState).Add("USER_COUNT",1)
Started")
        
    End Sub

regards,
Brian
The problem with doing something right the first time is that nobody appreciates how difficult it was.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top