Asp.net mvc 4 - Need to use sessions but can't use cookies
Asked Answered
D

1

1

I am working on an ASP.NET MVC 4 application.

I need to use the session for storing various things. My mandate is to not use cookies.

Is there a way I can work through this? I have been told that ASP.NET MVC 4 will not work in cookie-less mode.

Is there any other alternative way?

Disvalue answered 2/3, 2013 at 15:52 Comment(2)
MVC 4 will most certainly work without cookies. So long as you don't use them. And Session support hasn't changed at all in MVC 4.Rounded
I was under the impression MVC does not support cookieless sessions? If you create a test project with cookieless sessions enable in the web.config everything seems to work okay. But then try and create a simple ActionLink and it goes horribly wrong.Vashti
B
0

Edit your web.config

<sessionState cookieless="true" timeout="20" />
Bigamy answered 14/3, 2013 at 17:45 Comment(4)
There is also a line in the FormsAuthenticationService, in the SignIn() method that writes to a cookie. How do we deal with that?Duvalier
Its related to the original question, your accepted answer above does not address both issues for cookieless mvc apps, your answer is only a partial answer.Duvalier
I understand, I will ask another question. But do know that if his mandate was to be truly cookieless, this answer doesn't address the "other" cookie that gets created upon login.Duvalier
"My mandate is to not use cookies.", I assumed that meant ALL cookies, my apologies if that was presumptuous of me.Duvalier

© 2022 - 2024 — McMap. All rights reserved.