Solved

What is the best way(Session/cookies) save login credentials like login name, role etc.?

Posted on 2013-11-05
4
358 Views
Last Modified: 2013-11-11
What is the best way(Session/cookies) save login credentials like login name, role etc.?
0
Comment
Question by:Raj_donet
  • 2
4 Comments
 
LVL 5

Expert Comment

by:ckluka
ID: 39624357
You'll have to be more specific. Do you mean save credentials for the user so they don't have to enter them again? or save a session token so the user is identifyable across login sessions? or...

Give me some kind of user story to go along with this. Your question is way too vague.
0
 

Author Comment

by:Raj_donet
ID: 39624592
When user login into the website, I want to save the username in a session, so that I can user the sessions object as pass check the credentials, later when get the role and save in session and retain the username and object through multiple pages. I usually use Session to do this. but I want to know if there is any specific advantage of using cookie over session. Which one is more secure?
0
 
LVL 20

Accepted Solution

by:
Daniel Van Der Werken earned 500 total points
ID: 39625604
Session is more secure. It's created on the server and the user can never see it. Cookies are created at the client and viewable unless encrypted.

http://forums.asp.net/t/1849080.aspx

http://www.codeproject.com/Questions/410609/in-session-and-cookies-which-is-more-secure
0
 

Author Closing Comment

by:Raj_donet
ID: 39639417
Thanks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now