Forms Authentication does not work when using computer name
My asp.net app is using Forms Authentication. Running the project from the
Visual Studio .NET 2003 has absolutely no problem. I use the sample from
http://www.eggheadcafe.com/articles/20020906.asp as the forms authentication
framework. But it doesn't work when the page is accessed directly via an
independent IE. ie. http://ComputerName/MyApp/default.aspx. After clicking
the Login button, the authentication code run with no error, but the Login
page kept getting reloaded and reloaded. I installed the app on a second
computer to repeat the same test on that computer, and still run into the
same problem. Testing is done on the same computer as the iis hosting the
asp.net application, all single machine.
However, accessing the page with either http://localhost/MyApp/default.aspx
or http://ip#.xx.xx/MyApp/default.aspx is working fine.
It's really strange, because it is the same code, on the same computer,
works from VS.NET IDE, localhost, ip, but not computer name.
Your input is greatly appreciated.
My IIS is version V5.1, OS is WinXPPro, .NET framework is version 1.1.
1. Excerpt from my config file
<forms name="FormsAuthDB.AspxAuth" loginUrl="login.aspx"
protection="All" timeout ="10" path="/"/>
<deny users="?" />
2. Code from Application_AuthenticateRequest
protected void Application_AuthenticateRequest(Object sender, EventArgs e)
if (HttpContext.Current.User != null)
FormsIdentity fi = (FormsIdentity)HttpContext.Current.User.Identity;
FormsAuthenticationTicket fat = fi.Ticket;
string userData = fat.UserData;
string roles = userData.Split(',');
// Create a new Generic Principal Instance and assign to Current User
HttpContext.Current.User = new
|All times are GMT. The time now is 12:40 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.