Search

You searched for the word(s): userid:674260

Matching Posts

  • Re: FormsAuthentication.Authenticate() fails after creating new user

    ecbruck: If you need to redirect after validating the user, use the FormsAuthentication.RedirectFromLoginPage Method. I didn't mention FormsAuthentication.RedirectFromLoginPage, because I didn't want to assume this was a login page per se. It could have been a custom member creation scenario as well. In which case the aforementioned method lacks the control over the return URL destination. Cheers
    Posted to Security (Forum) by leviticus on 8/10/2006
  • Re: FormsAuthentication.Authenticate() fails after creating new user

    leviticus: Use the following: if (Membership.ValidateUser(username, password) == true) { bool persist = false; // could use a remember me checkbox to toggle string url = "default.aspx"; // could grab the previous URL on Page_Load, before PostBack // and persist the URL in a State Bag (ViewState, Session, Cache, etc) FormsAuthentication.SetAuthCookie(username, persist); Response.Redirect(returnUrl, false); } else { // handle user not authenticating properly } It's unfortunate this forum doesn't support
    Posted to Security (Forum) by leviticus on 8/10/2006
  • Re: FormsAuthentication.Authenticate() fails after creating new user

    Use the following: if (Membership.ValidateUser(username, password) == true) { bool persist = false; // could use a remember me checkbox to toggle string url = "default.aspx"; // could grab the previous URL on Page_Load, before PostBack // and persist the URL in a State Bag (ViewState, Session, Cache, etc) FormsAuthentication.SetAuthCookie(username, persist); Response.Redirect(returnUrl, false); } else { // handle user not authenticating properly }
    Posted to Security (Forum) by leviticus on 8/10/2006
  • Re: forms authentication timeout and persistent cookies

    This is a potential work-around for use with cookie persistance: protected void Login1_LoggedIn(object sender, EventArgs e) { if (Response.Cookies.Count > 0) { foreach (string s in Response.Cookies.AllKeys) { if (s == FormsAuthentication.FormsCookieName) { if (Login1.RememberMeSet == true) { // change the value to increase the cookies expiration by Response.Cookies[s].Expires = DateTime.Now.AddYears(1); } } } } }
    Posted to Security (Forum) by leviticus on 8/9/2006
Page 1 of 1 (4 items)