what is the alternative of Session variable in C#?
I want to keep logged in user for further use without using session. How can i do that? What's the best option?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bhushan GawalePosted Jan 18, 2015, 12:55 AM
- ViewState
- Hidden Fields
- Cookies
- Query Strings
It is highly recommended that - you should use the above mentioned for storing non sensitive and light weight data, because it is exposed in the client application (e.g. browser).Another server side state management technique is the use of application variables - but those cannot be used as alternative to session variables, as application variables are shared acros your users.
For your case - I guess you can rely on cookies but again - make sure you don't save anything sensitive in it.
Read more about usage of cookies here - http://asp.net-tutorials.com/state/cookies/
Manish Kumar ChoudharyPosted Jan 17, 2015, 11:49 PM