As Levi stated above, cookieless sessions are not supported in ASP.NET MVC (only in WebForms), and it's likely that we will never support cookieless sessions in MVC.
@bradwils: Is this really true? It's also broken for Forms Authentication.
I have a requirement from a client that we don't use cookies for both session and authentication as their browser policy doesn't allow them. This bug with the Html.BeginForm() helper method is the first problem I've encountered. What other issues will
I have using cookieless session and forms authentication in MVC3? It all appears to be working at the moment (both session and authentication) by avoiding the default overload and using instead e.g.:
@using (Html.BeginForm("Login", "Authentication", new { ReturnUrl = Request["ReturnUrl"] }, FormMethod.Post))
That seems a little drastic to change frameworks to one that isn't testable just so I can use cookieless sessions and authentication doesn't it? I'm a big fan of the MVC framework especially the latest MVC3 release. Given that it appears to work by avoiding
the html.beginform() default overload, I am interested to know in what other ways it isn't supported in MVC, i.e. what other problems am I likely to encounter?
Ps. I am aware of how unsecure uri re-writing is! however what other options are there if cookies are disabled in the browser?
That seems a little drastic to change frameworks to one that isn't testable just so I can use cookieless sessions and authentication doesn't it?
Yes. However, you can not do much about it. The MVC is designed from the beginning to NOT support cookieless. I understand the motivation( the routes get's over complicated ).
But, if you want to try, the MVC source is free on codeplex. Give it a try ;-)
The MVC is designed from the beginning to NOT support cookieless
Is there any plan to suport this in future? The fact is that browsers still have the option to disable cookies so is something which needs to be supported. If browser manufacturers changed the option to only allow persistent cookies to be disabled it would
eliminate these sorts of headaches, but unfortunately at the moment persistent and non-persistent cookies are disabled together :(
Tony Leeper
Member
6 Points
3 Posts
Cookieless sessions and forms authentication in MVC3
Sep 28, 2011 09:36 PM|LINK
@bradwils: Is this really true? It's also broken for Forms Authentication.
I have a requirement from a client that we don't use cookies for both session and authentication as their browser policy doesn't allow them. This bug with the Html.BeginForm() helper method is the first problem I've encountered. What other issues will I have using cookieless session and forms authentication in MVC3? It all appears to be working at the moment (both session and authentication) by avoiding the default overload and using instead e.g.:
@using (Html.BeginForm("Login", "Authentication", new { ReturnUrl = Request["ReturnUrl"] }, FormMethod.Post))My web.config is e.g.
By the way, it looks like it's a problem here:
I think you could change that line to:
Regards,
Tony
ignatandrei
All-Star
134491 Points
21566 Posts
Moderator
MVP
Re: Cookieless sessions and forms authentication in MVC3
Sep 28, 2011 10:33 PM|LINK
Then use WebForms. But I doubt the client want to use QueryString session as they are more secure ....
Tony Leeper
Member
6 Points
3 Posts
Re: Cookieless sessions and forms authentication in MVC3
Sep 29, 2011 12:41 PM|LINK
That seems a little drastic to change frameworks to one that isn't testable just so I can use cookieless sessions and authentication doesn't it? I'm a big fan of the MVC framework especially the latest MVC3 release. Given that it appears to work by avoiding the html.beginform() default overload, I am interested to know in what other ways it isn't supported in MVC, i.e. what other problems am I likely to encounter?
Ps. I am aware of how unsecure uri re-writing is! however what other options are there if cookies are disabled in the browser?
ignatandrei
All-Star
134491 Points
21566 Posts
Moderator
MVP
Re: Cookieless sessions and forms authentication in MVC3
Sep 29, 2011 12:50 PM|LINK
Yes. However, you can not do much about it. The MVC is designed from the beginning to NOT support cookieless. I understand the motivation( the routes get's over complicated ).
But, if you want to try, the MVC source is free on codeplex. Give it a try ;-)
Tony Leeper
Member
6 Points
3 Posts
Re: Cookieless sessions and forms authentication in MVC3
Sep 29, 2011 03:36 PM|LINK
Is there any plan to suport this in future? The fact is that browsers still have the option to disable cookies so is something which needs to be supported. If browser manufacturers changed the option to only allow persistent cookies to be disabled it would eliminate these sorts of headaches, but unfortunately at the moment persistent and non-persistent cookies are disabled together :(
ricka6
All-Star
15070 Points
2272 Posts
Microsoft
Moderator
Re: Cookieless sessions and forms authentication in MVC3
Jun 20, 2012 09:40 PM|LINK
No