I have an issue with GenericHandler and anonymousIdentification.
Basically if <anonymousIdentification enabled="true" />
is turned on in the web config, whenever a JQuery GET/POST request is sent to the server, that request executes under a new user and a new user session.
Is there a way to mitigate this? I need to access the current user's session variables... It is really frustrating!
Generic handlers must implement the IReadOnlySessionState
interface to access session variables. If you also need to write session variables, implement IRequiresSessionState
.
Implement the System.Web.SessionState.IRequiresSessionState
interface:
public class Handler : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
context.Session["StackOverflow"] = "overflowing";
context.Response.Redirect("~/AnotherPage.aspx");
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With