Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET MVC
Hi,
 
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 2:24am
Edited 19-Mar-13 12:52pm
(no name)7.9K
v2

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

  Print Answers RSS
0 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 19 Mar 2013
Copyright © CodeProject, 1999-2014
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