Here is simple test I ran to verify that it is running twice:
Protected Sub Application_AcquireRequestState(ByVal sender As Object, ByVal e As System.EventArgs)
If Request.IsAuthenticated Then
System.Diagnostics.Debug.Print("Inside Application_AcquireRequestState")
End If
End Sub
If I try to referrence a session variable in the event, the first time it execute, I'm okay. On the second event, I get an error indicating that Session state is not available in this context.
Can anyone explain this or suggest how can I ensure that this event is only fired once

Application_AcquireRequestState Execute twice per request
Josh Zana
change autoeventwire up to false from true in your page html code.
AutoEventWireup="False
Sandy L
aao123
Jude Landry
wbartussek
I had to do this:
If Not System.Web.HttpContext.Current.Session Is Nothing Then
'YOUR CODE HERE
End IfAll this does is makes sure that session is available when your code executes. NOTE: I had to fully qualify (namespace) where to find Session for this to work right. I do not have any idea why, but I tried to import the name space and it still didn't work. I would like someone to answer that question...
Richard
Andrew Petrochuk
SVerhalle
This works!. Even though the AcquireRequestState gets fired multiple times, the code in inside of the IF condition is only executed once.
Did you try importing the system.web namespace When I did that, I was able to shorten it statement to If not HttpContext.Current.Session is nothing ion by itself.
David
ClarkMe
http://forums.asp.net
Daniel Roth