Sunday, May 22, 2005

PEBCAC

//user authentication code hereFormsAuthentication.Initialize();
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
uid.Text,
DateTime.Now,
DateTime.Now.AddMinutes(30),
true,
string.Empty,
FormsAuthentication.FormsCookiePath);
string encryptedTicket = FormsAuthentication.Encrypt( ticket );
HttpCookie cookie = new HttpCookie( FormsAuthentication.FormsCookieName, encryptedTicket );
cookie.Expires = ticket.Expiration;
this.Page.Response.Cookies.Add (cookie);
this.Page.Response.Redirect("Default.aspx");

The above code used to work but just last week it provided wrong result. I was not able to login to Internet Explorer anymore, using a valid user name and password, however I could login to Firefox without any problems. In addition to that, not all computers in our department exhibit such behavior. There are computers that could login using IE but there are some that don't. I have check various websites for the issue and some says that WebUIValidation.js might be the culprit. I implemented the workarounds suggested but the problem persisted. After a couple more hours of debugging I've finally found the problem -- me.

1 comment:

GoGo said...

It needs www.

and

.com