Session and Cookies

 I had problems with IE not saving cookies for a loadbalanced public web.


Using SQL as session server:

On both frontend webservers execute this with the identity used in the app pool:

cd \WINDOWS\Microsoft.NET\Framework\v4.0.30319\

rem Create tempdb.dbo.ASPStateTempApplications
rem Create tempdb.dbo.ASPStateTempSessions

rem aspnet_regsql.exe -S <LocalPC>\SQLExpress -E -ssadd -sstype t
rem aspnet_regsql.exe -S <LoadbalancedWebserver> -E -ssadd -sstype p

rem t will create in tempdb, p will create in ASPSession db


    <sessionState mode=”SQLServer”
        sqlConnectionString=”data source=.\SQLExpress;Integrated Security=SSPI” sqlCommandTimeout=”15″
        cookieless=”AutoDetect” timeout=”20″/>


This trick did not work:

HttpContext.Current.Response.AddHeader(“p3p”, “CP=\”IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\””);


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: