SessionID length differs between .NET and SQL Server

Discussion in 'ASP General' started by Mark Meyers, Jul 20, 2010.

  1. Mark Meyers

    Mark Meyers Guest

    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?
    Mark Meyers, Jul 20, 2010
    #1
    1. Advertising

  2. Mark Meyers

    Dan Guest

    "Mark Meyers" <> wrote in message
    news:...
    > 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?

    --
    Dan
    Dan, Jul 21, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ronald
    Replies:
    6
    Views:
    6,923
    Andy Mortimer [MS]
    Feb 23, 2004
  2. Bart Rider
    Replies:
    9
    Views:
    466
    Chris Uppal
    May 30, 2006
  3. Replies:
    3
    Views:
    309
    Ivan Vecerina
    Nov 7, 2006
  4. Josef Dalcolmo

    getmtime differs between Py2.5 and Py2.4

    Josef Dalcolmo, May 7, 2007, in forum: Python
    Replies:
    16
    Views:
    536
    Joe Salmeri
    Jun 1, 2007
  5. Zeguudo Zegudissimo
    Replies:
    4
    Views:
    489
    Zeguudo Zegudissimo
    Sep 2, 2010
Loading...

Share This Page