Use of Session State ???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all,

I have an application that use session state without any trouble when my
SessionState element of my webConfig file is set to "InProc"

Then I just try some test to make it work as out process. For that I have
modefied the web config SessionStae element part as follow :

<sessionState
mode="SQLServer"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=nomos_srvr;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>

Then on the server side I install the ASPState database using the OSQL tool
as follow :
osql -s nomos_srvr -E installSqlStqte.sql

Then I run my application and get the following error :

Exception Details:
============
System.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason:
Not associated with a trusted SQL Server connection.

What does it means and how to solve it ?

Thanks fro your help
regards
serge
 
Serge,

You must specify a username/password combination in your sqlconnectionstring
attribute. Or, since you have used Trusted_Connection, you must give the
ASP.NET application an identity, because it is currently trying to login
with the ASP.NET account.
 
Does the ASP.NET application is given by the passwor and user in the
connection string or is it something else that I have to handle in code ?
 
the imperonated identioty account can not be used (unless you use kerberos
an enable creditial forwarding). in you web config define a impersonation
identity.

<identity impersonate="true" userName = "domain\accountwithsqlaccess"
password="thepassword" />

this will not change who the user is only the security creditials of the
request

note: if you use out of proc session, all session data must be serializable.

-- bruce (sqlwrok.com)
 
Hi bruce thaanks fro your reply.

Why do you mean in your note for Out process session to be serialized?
Session("myKey")="my key" does not work ion out process ?
 

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

Back
Top