Last post Jun 27, 2011 07:07 PM by ricka6
Jun 02, 2011 12:47 PM|Vale|LINK
I'm using SSL in my ASP.NET MVC 3 application. Once that the user enters in HTTPS mode, all the links in the page are generated with the HTTPS preface, but I'd like to "let the user leave" the HTTPS mode, and get back to HTTP when critical information exchange
has been already done.
Is there anyway in the Routes configuration or something to say something like: /Home/Index will be always HTTP
I've tried with:
But it fails when I'm using a custom port. I mean, at the beginning it is:
http://127.0.0.1:5104/Home/Index but when the link is generated from HTTPS it looks:http://127.0.0.1/Home/Index and of course it doesn't work. is it maybe a bug?
Jun 02, 2011 09:56 PM|chohmann|LINK
Try using this ActionLink overlaod that accpets a protocol paramter:
Jun 07, 2011 11:00 AM|Forest Cheng - MSFT|LINK
Try to write a custom Html helper to generate a link according to the protocol pamater(used to specify which protocol your want to use). Here a look at this link:
Hope this helpful,
Jun 27, 2011 12:47 PM|Vale|LINK
wow thanks a lot Cheng!
Jun 27, 2011 07:07 PM|ricka6|LINK
See my blog post
Many web sites log in via SSL and redirect back to HTTP after you’re logged in,
which is absolutely the wrong thing to do. Your login cookie is just as secret as your username + password, and now you’re sending it in clear-text across
the wire. Besides, you’ve already taken the time to perform the handshake and secure the channel (which is the bulk of what makes HTTPS slower than HTTP) before the MVC pipeline is run, so redirecting back to
HTTP after you’re logged in won’t make the current request or future requests much faster. For information on setting up
SSL on ASP.NET MVC, see my blog entry
Better, Faster, Easier SSL testing for ASP.NET MVC & WebForms.