Session key management

Posted by Viraat2000 under ASP.NET on 4/1/2014 | Points: 10 | Views : 522 | Status : [Member] | Replies : 1

I,want to know how to create a unique session key generated for each user login on my website?
What should be recommended length for session key?
if user closes session, or multiple users how to prevent /avoid duplication of session keys in the future?

Looking forward for any references or code and any changes need to be done in sql database level do let me know the same.

Viraat Kothare


Posted by: Vuyiswamb on: 7/8/2014 [Member] [MVP] [Administrator] NotApplicable | Points: 25


This should be enough

Session["User_id"] = "blablabla"; 

and when the user logs out then you set it to null

Thank you for posting at Dotnetfunda

Viraat2000, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response