session variables

randy_belcher

Freshman
Joined
Dec 10, 2003
Messages
37
Hello everyone.

I have created an asp.net application. The application works great on my local machine; however, when I run the app on a different server, the session variables are not being maintained. I have tried session state mode = InProc and StateServer. Is there a setting on the server that I am missing? Thanks for the help.
 
Maybe the session state is disabled.
Open IIS, on the Default Web Site properties, go to Base Directory tab and click Configuration. Then go to the Options tab. There you´ll see the session state configurations.
 
I assume so, since the app works on my local machine. I have tried both InProc and StateServer (turned the ASP service on for this as well) for the mode. I just created a simple test app. 2 pages. One sets the session variable - Session("Test") = "1" and the other justs displays it with a label - label.text = Session("Test").
This does not work either, so it has to be something with the server. What else is there that I can check. Thanks for the help.
 
i have done a little more testing.
in the application_start i created - application("Test") = 0
in session_start i have - application("Test") += 1
in session_end i have - application("Test") += 1

when i run the app using my machine as the local server
i get on page two

label1 = 1 (session("Test")) and
label2 = 1 (application("Test"))
This above is correct; however on the company server on page two i get

label1 = nothing (session("Test")) and
label2 = 3 (application("Test"))
Can anyone tell me why this happening. session_start i assume is firing twice and session_end is firing once.
 
Are you testing this from the same browser or are you running a different browser on each machine?

Could you also paste the session information from your web.config here - if possible both the version from the testing machine and the one from the server.
 
The browser I test with is the same. I test the client side from my machine. The only thing that is changing is the server. The session info is the same on both machines.

<sessionState
mode="StateServer"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
 
Are you browsing to the server via an ip address, server name or fully qualified domain name?
A quick search on google revealed a similar problem if the domain name of the server had an underscore _ in it. :confused:
 
Thank you very much. I do believe that was the problem. She is up and running. Can you believe an underscore can cause that many problems? Thats crazy if you ask me.
 
Back
Top