SessionID length differs between .NET and SQL Server

M

Mark Meyers

I have no clue what is happening and hope someone can explain this.

I have my Web site set up to use SQL Server session state. This works fine.
When a session starts, a row is created in ASPStateTempSessions.

When the user logs off the application, I am trying to call the stored
procedure TempRemoveStateItem to clean up after myself (not sure if this is
the right way to do it or not).

What I noticed is that the SQL table's SessionID column contains 32
characters whereas the .NET Session.SessionID value only contains 24
characters (which match the first 24 characters of the 32 characters stored
in the SQL table). Because the values do not match, the stored procedure
always fails.

Why would the SessionID value differ between .NET and SQL?
 
D

Dan

Mark Meyers said:
I have no clue what is happening and hope someone can explain this.

I have my Web site set up to use SQL Server session state. This works
fine.
When a session starts, a row is created in ASPStateTempSessions.

When the user logs off the application, I am trying to call the stored
procedure TempRemoveStateItem to clean up after myself (not sure if this
is
the right way to do it or not).

What I noticed is that the SQL table's SessionID column contains 32
characters whereas the .NET Session.SessionID value only contains 24
characters (which match the first 24 characters of the 32 characters
stored
in the SQL table). Because the values do not match, the stored procedure
always fails.

Why would the SessionID value differ between .NET and SQL?

This newsgroup is about classic ASP, not ASP.NET. You might have more chance
of an answer in the relevant dotnet group.

Personally, I've never looked into it. Without any example values to look at
it's hard to make an educated guess (I don't have an ASP.NET site to tinker
with either), but I would take a stab that the extra characters are an
identifier used to differentiate between servers in a farm, or multiple
sites in a single server, to prevent SessionID collisions across different
sites/servers. Do the extra characters bear any relation to the IIS site
identifier?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top