After the user entered his valid cridential, and the Identity.IsAuthenticated was true as well as Identiy.Name was not null. But still cannot direct to the protected page. The login page just kept the same.
Here are some code:
Web config:
protection="All"
timeout="60"
name=".OnlineShop"
slidingExpiration="true" requireSSL="false">
Code from login page:
string username = this.txtUserName.Text.Trim();
bool persistent = this.chkPersistent.Checked;
FormsAuthentication.Initialize();
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
username,
DateTime.Now,
DateTime.Now.AddMinutes(30),
persistent,
"User",
FormsAuthentication.FormsCookiePath);
// Encrypt the ticket.
string encTicket = FormsAuthentication.Encrypt(ticket);
// Create the cookie.
Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket));
string returnUrl = Request["ReturnUrl"];
if (string.IsNullOrEmpty(returnUrl))
returnUrl = GetVirtualPath() + "Default.aspx";
// Redirect back to original URL.
Response.Redirect(returnUrl);
Does anyone have some clues about my problem? It made me crazy for days.
Note: It works fine when running locally.

Anh Duc Thai61 reputationPosted Jan 13, 2008, 10:16 PM EST
Can anyone help me?
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Jan 14, 2008, 6:05 AM EST
u please check the connection string,while uploading into server.May be u have some problem in connection string in the time of uploading.
Anh Duc Thai61 reputationPosted Jan 14, 2008, 3:30 PM EST