code_junkie

Avoid losing PostBack user input after Auth Session has timed out in ASP.NET

Nov 12th, 2011
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. // Global.asax
  2. void FormsAuthentication_OnAuthenticate(object sender, FormsAuthenticationEventArgs e) {
  3. // check for postback somehow
  4. if (Request.Url == "MyPage.aspx" && Request.Form["MySuperSecret"] == "123") {
  5. e.User = new GenericPrincipal(new GenericIdentity(), new string[] { });
  6. }
  7. }
  8.  
  9. ( HttpContext.Request.UserHostAddress )
Add Comment
Please, Sign In to add comment