SQL Session State seems to ignore the data source

  • Thread starter Thread starter Andy Ginn
  • Start date Start date
A

Andy Ginn

Hi all,

This may be a longish message, to allow me to explain what I am doing,
and what the problem is.

I am using a SQL Server instance to store my session state from two
servers, each with it's own web.config. One server uses the ASPState
service correctly, I can see the sessions being added to the table in
tempdb correctly. If I change the name of the SQL Server in the
connection string, I receive the correct error message.

However, on the second server, no matter what I put as the data
source, the pages always work, examination of the session object tells
me that the page believes it is using SQL Server, but these is no
activity on the ASPState database.

My web.config entry reads:
<sessionState mode="SQLServer" sqlConnectionString="Data
Source=dummyname;user
id=lse_cws_sqlstate_dbo;password=lse_cws_sqlstate_dbo"
cookieless="false" timeout="35" />

The examination of the Session object in the debugger gives me:
?Session
{System.Web.SessionState.HttpSessionState}
System.Object: {System.Web.SessionState.HttpSessionState}
_abandon: false
_dict: {System.Web.SessionState.SessionDictionary}
_id: "hclgob25cnbxlqeu0rgigx3r"
_isCookieless: false
_isReadonly: false
_mode: SQLServer
_newSession: true
_staticObjects: {System.Web.HttpStaticObjectsCollection}
_timeout: 35
CodePage: 65001
Contents: {System.Web.SessionState.HttpSessionState}
Count: 0
IsAbandoned: false
IsCookieless: false
IsNewSession: true
IsReadOnly: false
IsSynchronized: false
Item: <cannot view indexed property>
Item: <cannot view indexed property>
Keys: {System.Collections.Specialized.NameObjectCollectionBase.KeysCollection}
LCID: 2057
Mode: SQLServer
SessionID: "hclgob25cnbxlqeu0rgigx3r"
StaticObjects: {System.Web.HttpStaticObjectsCollection}
SyncRoot: {System.Web.SessionState.HttpSessionState}
Timeout: 35

Can anyone please tell me why and how this works, and how I can get
this server to use the ASPState correctly? This is driving me nuts!!!

TIA
 
Hi Andy,

Thanks for your post. As I understand problem you are facing is that a web
service ASPState cannot be called properly from one server, while another
one works properly. Please correct me if there is any misunderstanding. I
think more information is needed before moving forward:

1. Are their web.config file of the same?
2. What if you use the following command to stop/restart IIS after changing
web.config?
3. Is it possible for your to post sample project and tell me the detailed
steps to reproduce the problem? I will be glad to check it on my side.

I look forward to hearing from you.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hello Andy,

I am currently standing by for an update from you and would like to know
how things are going there. Should you have any questions or concerns on
the recent questions/ information I've posted, please don't hesitate to let
me know directly. It's my pleasure to be of assistance.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top