Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ASP.net - SessionID storage in database

Posted on 2004-11-01
4
Medium Priority
?
4,144 Views
Last Modified: 2012-05-05
Have googled around but can't seem to find an answer.  Need to store the asp.net session ID in a sql server table but I can't work out the best datatype to store it with.  From what I've been able to find out, it's a hex 120 bit string.  Anyone got any ideas?  Thanks
0
Comment
Question by:Psychotext
4 Comments
 
LVL 25

Accepted Solution

by:
nauman_ahmed earned 600 total points
ID: 12469541
You can use VARCHAR 32 to store the session id. You can retrieve the session id using Session.SessionID.ToString().

Best, Nauman.
0
 
LVL 20

Assisted Solution

by:ihenry
ihenry earned 400 total points
ID: 12469619

HttpSessionState.SessionID data type is String, so you can just use nvarchar with a certain length. Or use char(32) as Microsoft use it for the Sql Server mode session state. like this

Dim p As New SqlParameter( "@SessionID",  sessionId )
p.SqlDbType = SqlDbType.Char
p.Size = 32

0
 
LVL 2

Author Comment

by:Psychotext
ID: 12469791
Thanks both.  Nauman wins this one by a nose, but I've also awarded ihenry some points for the additional info relating to the SQL server session state.
0
 
LVL 5

Expert Comment

by:fmonroy
ID: 21327761
I see no nose on their avatars, jk :)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question