JSP: new Session created on every access of page

Discussion in 'Java' started by Joe Randstein, Nov 29, 2003.

  1. Hi!
    I have a little problem with my JSPs. A new session is constructed
    every time the page is accessed, sure it is not working that way, as I
    can't store any data that way.

    I developed the code at home on Windows/Tomcat4.0.6 and it worked as
    it should, but when I deployed it on a Linux server the problem
    started. Every time the session has a new ID, isNew() responds with
    true.
    From my observation the browser isn't getting a cookie, so it
    obviously can't send back the cookie the next time it accesses the JSP
    and that should explain why a new session is created every time.
    But handcrafted cookies work on the Linux server and Browser, I tested
    that. But I wanted to use the session API and not do the work by hand.

    Does anybody have an idea what can be wrong? Is there a parameter I
    can check? Or a check in the tomcat config?


    Thank you very much for your responses
     
    Joe Randstein, Nov 29, 2003
    #1
    1. Advertising

  2. Joe Randstein

    Chris Smith Guest

    Joe Randstein wrote:
    > Hi!
    > I have a little problem with my JSPs. A new session is constructed
    > every time the page is accessed, sure it is not working that way, as I
    > can't store any data that way.
    >
    > I developed the code at home on Windows/Tomcat4.0.6 and it worked as
    > it should, but when I deployed it on a Linux server the problem
    > started. Every time the session has a new ID, isNew() responds with
    > true.
    > From my observation the browser isn't getting a cookie, so it
    > obviously can't send back the cookie the next time it accesses the JSP
    > and that should explain why a new session is created every time.


    What have you observed to indicate that the server is not sending the
    cookie?

    --
    www.designacourse.com
    The Easiest Way to Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
     
    Chris Smith, Nov 29, 2003
    #2
    1. Advertising

  3. Chris Smith <> wrote in message news:<4.net>...
    > Joe Randstein wrote:
    > > Hi!
    > > I have a little problem with my JSPs. A new session is constructed
    > > every time the page is accessed, sure it is not working that way, as I
    > > can't store any data that way.
    > >
    > > I developed the code at home on Windows/Tomcat4.0.6 and it worked as
    > > it should, but when I deployed it on a Linux server the problem
    > > started. Every time the session has a new ID, isNew() responds with
    > > true.
    > > From my observation the browser isn't getting a cookie, so it
    > > obviously can't send back the cookie the next time it accesses the JSP
    > > and that should explain why a new session is created every time.

    >
    > What have you observed to indicate that the server is not sending the
    > cookie?


    I turned on the browser cookie warning, which pops up a requester
    every time a cookie is received. No requester came when a new session
    was started, but a request came when I sent a handmede cookie in my
    jsp. So I assume somehow tomcat was not generating a cookie for me,
    but I don't know the reason ...
     
    Joe Randstein, Nov 30, 2003
    #3
    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. Replies:
    1
    Views:
    360
    Alvin Bruney - ASP.NET MVP
    Nov 7, 2005
  2. Steven
    Replies:
    1
    Views:
    353
    Viator
    Mar 7, 2005
  3. =?Utf-8?B?SXJ3YW5zeWFo?=
    Replies:
    4
    Views:
    2,480
    =?Utf-8?B?SXJ3YW5zeWFo?=
    Oct 30, 2007
  4. New session for every page???

    , Oct 11, 2006, in forum: ASP General
    Replies:
    5
    Views:
    161
  5. TonyV
    Replies:
    19
    Views:
    1,048
    Mark Clements
    Mar 19, 2007
Loading...

Share This Page