User-296654088 posted
I want to create user preferences cookies and persist them even after user session expires. In the cookie, I will store things like some of user preferences, their avatar URLs, etc. I want these cookies to stay on user's computer till they're removed --
either by users or my app.
I use Facebook/Google authentication in my ASP.NET MVC app so I already use cookies but they expire when user ends his/her session. This is the behavior I want for cookies that are used for authentication purposes.
The user preferences cookie should however persist until my app or user removes them.
What is the right approach to doing what I want to do? I can think of two approaches:
- Do not expire the cookie but change a value in it to indicate that the user's session has expired.
- Create another cookie with a different name that stores user info/preferences.
I wanted to see how others handled this.