Session State Asp Temp Session db

Q.SessionID is hashed and too lengthy for us to use as a unique identifier. How can we add or
use a short number which serves the same purpose as the sessionID?
ckrafthoferAsked:
Who is Participating?
 
Jesse HouwingConnect With a Mentor Scrum Trainer | Microsoft MVP | ALM Ranger | ConsultantCommented:
What do you want to use this identifier for? And do you want to access it only from the database? Or also from the ASP.NET code?

It would be reasonably simple to put a numeric column in the session table with a trigger which fills it upon creation (for security purposes you want this to be a unique random number). Or, if you're never exposing this ID externally, you could use an identity column.

Something else I'd like to know is how/why the unique id in SessionId is too long for your purposes?
0
 
ckrafthoferAuthor Commented:
Well, we need smaller number in order to track the user's movement thru several sections in our website and they have their own navigational db.
0
 
Jesse HouwingScrum Trainer | Microsoft MVP | ALM Ranger | ConsultantCommented:
why can't you use the sessionid from the default asp.net db then?

If you only need to track them while the session is live and when you don't need access to it directly in the database, why not put a value in the session in the global.asax and read that?
0
 
ckrafthoferAuthor Commented:
His additional information was also accurate..about global.asax
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.