cookie management in Tomcat and Websphere


Web tier: servlets, JSP, Web frameworks: cookie management in Tomcat and Websphere

  1. cookie management in Tomcat and Websphere (3 messages)

    in my application
    - the user opens a page for the first time (and some objects are stored in the web session)
    - this page (in a custom tag) makes a request to a servlet

    I would like that the servlet could see the same web session of the calling code so I use cookies:

    URLConnection conn = url.openConnection();
    String cookie;
    conn.setRequestProperty("Cookie", cookie);

    where cookie is something like "JSESSIONID=43527628366".
    This works fine in Tomcat but doesn't work with Websphere 5 :-(

    I can see only two options:
    - my code is not standard
    - Websphere bug ????

    Can anybody help me to find a solution which work for both web containers?

    Thank you very much in advance!!


    Threaded Messages (3)

  2. Noticed a problem before!!![ Go to top ]

    Just as an FYI: When using WAS 3.5 a couple of years ago, we noticed the problem you mention here. We decided to use URL rewriting instead.

  3. Try this...[ Go to top ]

    Note the syntax: ("Cookie", "sesessionid=4553cx987e2")

    sesessionid?? May be that's the secret...
  4. Try this...[ Go to top ]

    I followed your hint but that doesn't work with WAS 5.0 ....
    It seems that WAS has a custom cookie management.

    Still looking for the solution (possibly different from changing application server :-))

    Does anybody know some good resources (other tips'n tricks like the one mentioned in srinivasan's post) ??