0

In my ASP.NET MVC3 application I don't ever explicitly use SessionStateModule and so I assume I can just remove it by changing web.config. The application is hosted in Azure web role so I can't rely on per-instance session states anyway, can I?

Will removing this module likely break something or can I just remove it?

sharptooth
  • 167,383
  • 100
  • 513
  • 979

2 Answers2

0

You are right, InProc will not work on Windows Azure. Here some options:

-Store session state using Sql Database

-Store session state using Table storage

-Store session state using Windows Azure Caching (recommended)

More information in here:

http://msdn.microsoft.com/en-us/library/windowsazure/gg185668.aspx

https://www.simple-talk.com/cloud/platform-as-a-service/managing-session-state-in-windows-azure-what-are-the-options/

Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90
  • Em... I don't actively want to store the session state. I wanted to know if I can just get rid of the module. – sharptooth Oct 09 '13 at 11:50
  • @sharptooth sorry. I read wrongly. TempData uses SessionState to store information. If you disable, it won't work. http://www.dotnet-tricks.com/Tutorial/mvc/906b060113-Controlling-Session-Behavior-in-Asp.Net-MVC4.html http://www.dotnetcurry.com/ShowArticle.aspx?ID=609 http://stackoverflow.com/a/4235006/1384539 – Thiago Custodio Oct 09 '13 at 12:52
0

It depends on how your application is designed and what features you are using. If the application is 100% stateless, then session state can be removed.

Bart Czernicki
  • 3,663
  • 1
  • 21
  • 19
  • As mentioned in the answer above, certain features will not work without Session State...the obvious answer is that remove it from web.config and test the application. – Bart Czernicki Oct 09 '13 at 14:14