Click here to Skip to main content
15,905,504 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a website with a number of aspx pages and one of them requires generating unique session id when an user comes in. This session id should be in time structured string as yyyymmddhhmmssms (year,month,day,hour,minute,second,milisecond). So when an user accesses to this particular aspx page, the user gets an unique session id. Then when finish button is clicked the session id is fired and will never be reused.
Posted

SessionIDManager.CreateSessionId[^] will help you create a session id.
Try this answer[^] as well.
 
Share this answer
 
I don't know why exactly you need the id to be unique. As far as I know Session is unique to user, which can't be shared with other users.

So, whatever may be the id, it will hold values which can't be shared across users.
 
Share this answer
 
As web server is multi-threaded it generates the unique session for each user visiting your site. So that can't be shared among the users.

Hence, you don't have to explicitly create the new session-id, webserver would do that for you.

Though, you can use Guid. And look at here[^]

-KR
 
Share this answer
 
This is a very bad idea. If your session ids are time based then they are guessable by malicious users. It wouldn't take me long to get a successful hit and hijack your sessions.
 
Share this answer
 

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