Author: shapper | Posted on: 10/5/2009 4:02:04 PM | Views : 304

Hello,
I am using my own custom Membership/Roles system with Forms Authentication.
On my SignIn method I have the following:
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, user.Username, DateTime.UtcNow, DateTime.UtcNow.AddMinutes(30), true, String.Join(",", user.Roles.Select(r => r.Name).ToArray()), FormsAuthentication.FormsCookiePath); String hash = FormsAuthentication.Encrypt(ticket); HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, hash); if (ticket.IsPersistent) cookie.Expires = ticket.Expiration; HttpContext.Current.Response.Cookies.Add(cookie); String url = HttpContext.Current.Request.QueryString["ReturnUrl"]; if (url == null) url = "/"; HttpContext.Current.Response.Redirect(url);
And on Authentication Request I have the following (I am using a module: ...

Go to the complete details ...