Weird forms authentication, Please help!!!
From: chris han (chris_han@baxter.com)
Date: 02/11/03
- Next message: Patrick C. Cole [MSFT]: "RE: Web Forms Auth fails when rfValidator triggered"
- Previous message: Shel Blauman [MSFT]: "Re: Impersonation/Declarative security fails"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "chris han" <chris_han@baxter.com> Date: Tue, 11 Feb 2003 12:06:19 -0500
Hi, all,
I get this problem only on some specific combination of server and client:
I have a logon page:
//////////////////////////////////////////////////////
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,CurrentUser.UserId, System.DateTime.Now,System.DateTime.Now.AddDays (1), false,"Admin");
HttpCookie AuthCookie = new HttpCookie (FormsAuthentication.FormsCookieName);
AuthCookie.Value= FormsAuthentication.Encrypt (ticket);
Response.Cookies.Add (AuthCookie);
FormsAuthentication.RedirectFromLoginPage(CurrentUser.UserId, false);
//////////////////////////////////////////////////////
I was kept sending back to this logon page.
I also tried this:
//////////////////////////////////////////////////////
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,CurrentUser.UserId, System.DateTime.Now,System.DateTime.Now.AddDays (1), false,"Admin");
HttpCookie AuthCookie = new HttpCookie (FormsAuthentication.FormsCookieName);
AuthCookie.Value= FormsAuthentication.Encrypt (ticket);
Response.Cookies.Add (AuthCookie);
Response.Redirect ("SecondPage.aspx");
//////////////////////////////////////////////////////
It showed "Object is moved." and coming with a link to "SecondPage.aspx", when I clicked on that, I was sent back to longon page again.
I then try this:
//////////////////////////////////////////////////////
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,CurrentUser.UserId, System.DateTime.Now,System.DateTime.Now.AddDays (1), false,"Admin");
HttpCookie AuthCookie = new HttpCookie (FormsAuthentication.FormsCookieName);
AuthCookie.Value= FormsAuthentication.Encrypt (ticket);
Response.Cookies.Add (AuthCookie);
Server.Transfer ("SecondPage.aspx");
//////////////////////////////////////////////////////
I past the "SecondPage.aspx"! but been sent back again when I went further.
It does not seem like a cookie issue cause I put a line of code after, like this:
strAuth=Request.Cookies[FormsAuthentication.FormsCookieName].Value ;
and I got the value.
Thank for any clue?
Chris Han
- Next message: Patrick C. Cole [MSFT]: "RE: Web Forms Auth fails when rfValidator triggered"
- Previous message: Shel Blauman [MSFT]: "Re: Impersonation/Declarative security fails"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|