I am having an issue with my ASP MVC application. When I Log in in IE and open the site with firefox I find my self not logged in. I can’t find where is the problem.
Here is how I log in
FormsAuthentication.SetAuthCookie(ContactFound.ContaLogin, model.RememberMe);
if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/")
&& !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
{
return Redirect(returnUrl);
}
else
{
return RedirectToAction("Index", "Home");
}
Is there a roblem with this code ?
Thanks.
Cookies (which .NET authentication relies on) will not be available between browsers, so what you’re observing is the expected behavior.
If you are dedicated to having the login persist between browsers, you can enable
cookie-lessauthentication in the web.config and then the token will be in the URL. You can paste the URL into a different browser and you’ll still be logged in. http://msdn.microsoft.com/en-us/library/aa479314.aspx. However, this is not recommended: http://forums.asp.net/p/1517391/3634908.aspx