Click here to Skip to main content
13,001,454 members (60,891 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I am in the process of re-developing a ASP.NET web forms application to an ASP.NET MVC application. I'm also an MVC newbie, so bare bear with me!

One area that I'm unsure about is how to handle settings that are unique to each session. I have played with a custom membership provider but I don't think this will work for my application. The web forms application used the session to store settings:

- User accessed site: windows logon checked, if matched a record in the DB then the user was logged on, otherwise redirected to logon form. Users information stored in a CurrentUser session variable. This session variable is accessed to determine what can / can not be seen on some pages depending on their user level.

- User would be presented with 'default' filtering / sorting of items on the homepage. When filter/sort was changed, the changes were stored in the session variable. If the user navigated away from the homepage and then returned the values in the session were used to display the homepage as they left it.

- More than one user could log on with the same credentials - i.e. 'generic' logons were being used.

All the MVC documentation would seem to suggest that the use of the session object should be avoided (we should be stateless). If I use a custom membership provider to store user filters/sort orders then won't it effect ALL users using the credentials?

What is the 'correct' MVC way to handle this scenario?

Thanks for any help!

<Aman.A>fixed a pretty scary typo</Aman.A>
Posted 19-Mar-13 1:24am
Updated 19-Mar-13 11:52am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170624.1 | Last Updated 19 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100