Click here to Skip to main content
15,898,769 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need a help for Setting a session token length as 32 bit in asp page ,how can i make that?
Posted

1 solution

Refer - SessionIDManager Class[^].
Quote:

The SessionIDManager class is an HTTP module that manages unique session identifiers for use with ASP.NET session state. The unique identifier for an ASP.NET session is the SessionID property, which can be accessed from the Session property of the current HttpContext or Page. The ASP.NET session identifier is a randomly generated number encoded into a 24-character string consisting of lowercase characters from a to z and numbers from 0 to 5.


Also refer - Session ID not random enough - ASP.NET[^].
Quote:
If you want a better random session id you can use a RandomNumberGenerator such as RNGCryptoServiceProvider in your SessionIDManager and fill a bunch of bytes (say 32 which is 256 bits), then encode them using Base64
 
Share this answer
 
Comments
Praveen Kumar Upadhyay 24-Dec-14 3:00am    
Very nice explanation. +5
Thanks Praveen. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900