asp.net-mvcasp.net-mvc-3requirehttps

ASP.NET MVC [RequireHttps] - return to http


Once you place [RequireHttps] on an action and user switches from HTTP to HTTPS, all subsequent links will stay HTTPS...

Is there a way to switch back to HTTP ?


Solution

  • Technically, you could do it

    You could look at the source of RequireHttpsAttribute and reverse it.

    In practice, you probably shouldn't

    If the session is still alive, it is generally inadvisable to return to HTTP. This can be the foundation for a variety of attacks, for example, session hijacking.