cookie management in Tomcat and Websphere

Discussions

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

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

    Hi,
    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!!

    Andrea

    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.

    http://www-3.ibm.com/software/webservers/appserv/doc/v40/ae/infocenter/was/0404010101.html

    Thanks.
    --Srini
  3. Try this...[ Go to top ]

    http://forum.java.sun.com/thread.jsp?thread=82797&forum=46&message=214364

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

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

    Hi,
    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) ??

    Thanks,
    Andrea