[opencms-dev] Cookies in OpenCms 5.0
Michael LaBrie
mike.labrie at gmail.com
Wed Jan 11 13:25:09 CET 2006
Hi, list:
Just attempting to follow-up on this question and see if there might
be anything else I could provide. I am using OpenCms 5.0 and am
simply looking to set a named cookie; very little beyond that.
I was initially using JavaScript to set the cookie (which worked
perfectly offline, separate from OpenCms), but the session does not
remember the setting of the cookie when used within OpenCms.
I have seen the:
((HttpServletResponse)cmso.getRequestContext().getResponse().getOriginalResponse()).addCookie(cookie);
... response, but this appears to not be working for me. Perhaps I'm
missing something?
I have done some additional Googling and have come up with very
little. I have seen this question asked a few times in the past, and
a couple responses that appear as if someone may have figured
something out, but whatever the answer may be does not appear to be
contributed.
There's obviously a way to do it, and it's just a matter of figuring
that way out :). Thank you in advance for your help!
- Michael LaBrie
<< I am currently working with a site in OpenCms 5.0.
<<
<< I have been attempting to have a link that a user can click on one of
<< two pages; if from one page, it sets a value of "one", and the other
<< page, sets a value of "two". When they visit the main page of the
<< site, the page checks to see if one of these cookies is set; if so, it
<< automatically redirects them to the appropriate page ("one" or "two").
<<
<< This was easy enough to accomplish with JavaScript and get working
<< offline. However, this does not work within the OpenCms environment.
<< Something about sessions and caching, of course...!
<<
<< I have taken a look at the following thread:
<<
<< http://mail.opencms.org/pipermail/opencms-dev/2004q3/012903.html
<<
<< ... (and several others in the archives), but am unsure what to really do.
<<
<< Is there any specific workaround people have used? Any other
<< resources already documented somewhere? This seems like something
<< pretty basic that probably has an easy solution in OpenCms, as well.
<<
<< Let me know if I can provide any additional information or code bits.
<< Thanks so much for your help, and have a great new year.
<<
<<
<< - Michael LaBrie
More information about the opencms-dev
mailing list