• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 388
  • Last Modified:

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

What is the best way(Session/cookies) save login credentials like login name, role etc.?
0
Raj_donet
Asked:
Raj_donet
  • 2
1 Solution
 
cklukaCommented:
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
 
Raj_donetAuthor Commented:
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
 
Daniel Van Der WerkenIndependent ConsultantCommented:
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
 
Raj_donetAuthor Commented:
Thanks
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now