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?

Pallas
  • 1,499
  • 5
  • 25
  • 57
Hari Subramaniam
  • 1,814
  • 5
  • 26
  • 46
  • 1
    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. – Dave Alperovich Mar 02 '13 at 15:54
  • 1
    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. – Mark Erasmus Feb 07 '14 at 20:22

1 Answers1

0

Edit your web.config

<sessionState cookieless="true" timeout="20" />
Rob
  • 5,578
  • 3
  • 23
  • 28
  • There is also a line in the FormsAuthenticationService, in the SignIn() method that writes to a cookie. How do we deal with that? – Ed DeGagne Jun 28 '13 at 16:05
  • 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. – Ed DeGagne Jun 28 '13 at 17:55
  • 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. – Ed DeGagne Jun 28 '13 at 18:14
  • "My mandate is to not use cookies.", I assumed that meant ALL cookies, my apologies if that was presumptuous of me. – Ed DeGagne Jun 28 '13 at 19:34