Problem with ReturnUrl with asp.net mvc

I need to deal with an outdated asp.net mvc application that is not configured the way I'm used to. After a typical logout through:

FormsAuthentication.SignOut();

and

return RedirectToAction("Index", "Home");

URI contains:

ReturnUrl=%2f

This is usually not the case. How can I suppress this?

Alternatively, when I try to access a page that requires authentication / authorization, the login page appears, but the corresponding ReturnUrl = is not created (i.e. the URI remains as it is).

Is this an IIS issue that I read somewhere, or is the asp.net FormsAuthenticationModule method not configured correctly? Thank.

+5
source share
3 answers

ReturnUrl . -, , url (/) Home/Index. % 2f - "/".

web.config , .

+1

, ? :

routes.MapRoute(
 "Default", 
 "{controller}/{action}/{id}", 
new { controller = "Home", action = "Index", id = UrlParameter.Optional });
0

If nothing works, add authentication mode = "Windows" to your system.web attribute in your Web.Config file. hope this works for you.

0
source

All Articles