Link to home
Start Free TrialLog in
Avatar of Raj_donet
Raj_donet

asked on

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.?
Avatar of ckluka
ckluka

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.
Avatar of Raj_donet

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of Daniel Van Der Werken
Daniel Van Der Werken
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks