HELP! cookie succes depends on url structure (Struts?)

Discussion in 'Java' started by moo moo, Jul 21, 2003.

  1. moo moo

    moo moo Guest

    Im using Struts. I was having a problem setting a cookie in an Action
    Class, basically it wouldn't work. However I was able to set a cookie
    with no problem in another Action class. After many many hours of head
    scratching and a long process of elimination etc etc I discovered that
    if the action path is

    <action path="/dog"
    type="MyClass">
    </action>

    i.e. a url of http://localhost:8080/dog.do

    Then MyClass sets the cookie no problem. If the action path is

    <action path="/a/dog"
    type="MyClass">
    <forward name="pdboard1" path="/pdboard1.do"/>
    </action>

    i.e. a url of http://localhost:8080/a/dog.do

    then the cookie is not set. As soon as I changed the path from
    '/a/dog' to '/dog' it all worked with no problem.

    I guess this is a web server issue (Im using Resin)?

    Pehaps urls of the form http://www.mysite.com/a/dog.do are ok? (its
    only with http://localhost:8080 you get a problem )

    This probably explains why sometimes the URL is re-written with the
    JSESSIONID in it.

    Hmmmm -- I'm very worried now. Is this a known problem or have I been
    doing something wrong? Perhaps my web site is totally f****d up and I
    dont know it ... oh my god!!!!
    moo moo, Jul 21, 2003
    #1
    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. welsungo
    Replies:
    0
    Views:
    9,893
    welsungo
    Mar 5, 2005
  2. narke
    Replies:
    11
    Views:
    1,562
    narke
    Apr 22, 2005
  3. rbg
    Replies:
    1
    Views:
    397
    Jeeran
    Jul 3, 2006
  4. Gisle Vanem

    Module depends tool

    Gisle Vanem, Jan 8, 2004, in forum: Python
    Replies:
    0
    Views:
    352
    Gisle Vanem
    Jan 8, 2004
  5. Magnus Lycka
    Replies:
    10
    Views:
    479
Loading...

Share This Page