HttpCookie cookie; cookie = FormsAuthentication.GetAuthCookie(W3Account, isRemberMe); if (isRemberMe) { cookie.Expires = System.DateTime.Now.AddDays(1); } HttpContext.Current.Response.Cookies.Add(cookie); string targetUrl; targetUrl = FormsAuthentication.GetRedirectUrl(W3Account, isRemberMe); HttpContext.Current.Response.Redirect(targetUrl);