SessionId saved in SQL Server is different from the one generated from the asp.net runtime

主宰稳场 提交于 2019-12-24 06:01:11

问题


I have implemented SQL Server session mode for an asp.net application.

<sessionState mode="SQLServer" compressionEnabled="true" 
        sqlConnectionString="Data Source=.;User ID=xxxx;Password=yyyyy;Integrated Security=False;" 
        sqlCommandTimeout="240" allowCustomSqlDatabase="true" cookieless="false" />

I created a variable in the Session_Start in the global.asax file:

var sessionID = Session.SessionID;

I found the following data while debugging the application:

ASP.NET generated : lehxv4so4ioi2gqqaxtjzhyo
SQL Server saved  : lehxv4so4ioi2gqqaxtjzhyo84497b6f

Can anyone let me know what is reason for the different results as mentioned above.


回答1:


lehxv4so4ioi2gqqaxtjzhyo84497b6f

in bold is your sessionid and in italics is the application id

the extra 8 bytes are the applicationid



来源:https://stackoverflow.com/questions/9116100/sessionid-saved-in-sql-server-is-different-from-the-one-generated-from-the-asp-n

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!