5 Replies Latest reply on Nov 27, 2003 8:05 PM by jonlee

    cookie value not set

    svaret

      Hi,

      I am using a package for struts, struts-menu, that uses cookies set in a javascript to keep track of which menu item that will be shown as selected. ( The menu alternative I am using is tabbed menues. )
      The application I am testing this on is a Struts application.

      continues next reply

        • 1. Re: cookie value not set
          svaret


          Background:
          When a user clicks a tab a cookie is set, document.cookie = "......". The request is posted to the server and when the browser is returned control the javascript looks up the cookie and should select the right tab.

          Now the problem:
          The 1st time the browser receives the control from the server the menuSelected-cookie is null?!!! Although I have queried the cookie value before submitting the 1st time. The effect is that no tab is selected. At this point, document.cookie is only set to jsessionid="...".
          However, if I then click another tab, and after click an infinite number of times it works!!! It's only the first time it fails.

          Does anyone have a clue?

          Best regards
          Lasse Bergstrom

          • 2. Re: cookie value not set
            svaret

            war file

            • 3. Re: cookie value not set
              svaret

              btw... got an error when I had åäö , i.e. Swedish characters. The way I did this was using the html sequences for those characters, & aring; & auml; & ouml; ( put spaces here to be able to show it )

              Best regards

              Lasse

              • 4. Re: cookie value not set
                svaret

                What I meant by my last reply was that this forum can't handle Swedish charactes. hmmmm...

                • 5. Re: cookie value not set
                  jonlee

                  I think you need a protocol listener to see when and if the cookie gets set.

                  However, on the first dynamic page, you won't get a cookie returned from the browser ... if I am reading your problem correctly. You set the cookie after it requests the first page. So the second page request will contain the set cookie.