ASP.NET Session: Can't store

Discussion in 'ASP .Net' started by Sachin, Nov 3, 2005.

  1. Sachin

    Sachin Guest

    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
    Sachin, Nov 3, 2005
    #1
    1. Advertising

  2. Are you getting an error or are they lost when when you access them later?

    "Sachin" wrote:

    > 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
    >
    >
    >
    =?Utf-8?B?RGF2ZQ==?=, Nov 3, 2005
    #2
    1. Advertising

  3. Sachin

    xhead Guest

    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
    xhead, Nov 3, 2005
    #3
  4. Sachin

    Sachin Guest

    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" <> wrote in message
    news:...
    > Are you getting an error or are they lost when when you access them later?
    >
    > "Sachin" wrote:
    >
    > > 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
    > >
    > >
    > >
    Sachin, Nov 3, 2005
    #4
  5. Sachin

    Sachin Guest

    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.

    "xhead" <> wrote in message
    news:...
    > 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
    >
    Sachin, Nov 3, 2005
    #5
  6. 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








    "Sachin" wrote:

    > 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.
    >
    > "xhead" <> wrote in message
    > news:...
    > > 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
    > >

    >
    >
    >
    =?Utf-8?B?RGF2ZQ==?=, Nov 4, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Smythe
    Replies:
    3
    Views:
    1,239
    Jeff Smythe
    Jan 2, 2004
  2. far asl via DotNetMonster.com

    How can i share asp session data with asp.net session data

    far asl via DotNetMonster.com, Mar 22, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    545
    =?Utf-8?B?VmliaHUgQmFuc2Fs?=
    Mar 23, 2005
  3. =?Utf-8?B?UnVkeQ==?=

    to store or not to store an image

    =?Utf-8?B?UnVkeQ==?=, Mar 29, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    634
    =?Utf-8?B?UnVkeQ==?=
    Mar 30, 2005
  4. jnickfl1
    Replies:
    0
    Views:
    582
    jnickfl1
    Sep 18, 2006
  5. Zach Dennis
    Replies:
    2
    Views:
    148
    Joel VanderWerf
    Jan 8, 2004
Loading...

Share This Page