ASP.NET Session: Can't store

S

Sachin

Hi All,

I have an ASP.NET application deployed under a Web Site in IIS6.0

I have specified session mode as "InProc".

However, all calls to Session[key]= value are failing.

If I set, cookieless = true, then application works fine.

Are there any permission specific requirements to store into Session?

TIA
Pitu
 
X

xhead

It sounds like the browser you are testing your application from is not
allowing cookies. By default, sessions are identified by passing a
cookie to the client when they establish a session with the server,
then subsequent requests to the server include that cookie, which
identifies the session for that client.

If the browser is set to disallow cookies, then it refuses to accept
the session cookie and the client never establishes a session on the
server.

By setting cookieless=true on the server, ASP.NET will now put the
session ID in the querystring (take a took, it's there) which is the
substitute for the session cookie. A request from the browser will
include the session ID and that is parsed by ASP.NET and establishes
the session with the client.

No specific server-side permissions are required to access the Session
object - it's a question of the mechanism for the client to identify
itself with a particular Session on the server.

Mike
 
S

Sachin

They are lost when I try to access them. Because of that my application does
not work and throws the NullReferenceException.
Session.Count is always 0.

Dave said:
Are you getting an error or are they lost when when you access them later?

Sachin said:
Hi All,

I have an ASP.NET application deployed under a Web Site in IIS6.0

I have specified session mode as "InProc".

However, all calls to Session[key]= value are failing.

If I set, cookieless = true, then application works fine.

Are there any permission specific requirements to store into Session?

TIA
Pitu
 
S

Sachin

Cookies are allowed.

In fact, same application is deployed on 3 different server. We are just
testing the deployment across different servers.
This problem is only with one server.

If I access the other two applications from my machine they works fine.
 
G

Guest

Sachin,

If you are testing these servers stand-alone, check the IIS settings, Home
Directory, Configuration Button, Options tab that the Sessions are enabled
for the server in question.

If you are testing the app in a web farm, the InProc won't work.

In regards to the Null Object reference, "It is important to remember that
session variables are now objects. Thus, to avoid a run-time error, you
should check whether the variable is set before you try to access it." See
the following for more info:

http://support.microsoft.com/default.aspx?scid=kb;en-us;307598
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top