When storing TWIKIPREFS in cookies, like twisty does, they are
annotated with the
path
, which is the url up to / including the web.
This results in this TWIKIPREF only being in effect at this path (web).
That's not always wanted as me, at least, I was expecting them to
be
not web-specific. Example: the (upcoming)
NatSkin uses a twisty to
fold away the broadcastmessage and uses twisties in the sidebar navigation.
I want them to be remembered while changing webs. So once I have hidden
the broadcastmessage I don't want it to pop up again when I move around.
For now I added and explicite path to
_writePrefValues
in
twiki.js
:
- SetCookie(TWIKI_PREF_COOKIE_NAME, cookieString, expiryDate);
+ SetCookie(TWIKI_PREF_COOKIE_NAME, cookieString, expiryDate, '/');
But I am pretty sure that this is wrong as it should pass over a
path string that has only the
web part of the current path striped off ...
which I didn't figure out how to do
that, i.e. with hierarchical webs in mind. Anyone with more javascript
knowhow?
Or maybe the above is "good enuf".
MD
The path gives you the chance to specify a directory where the cookie is active. So if you want the cookie to be only sent to pages in the directory cgi-bin, set the path to /cgi-bin. Usually the path is set to /, which means the cookie is valid throughout the entire domain. (
http://www.quirksmode.org/js/cookies.html)
So cookies are currently stored with a directory path where they shouldn't. The path should indeed be
/
.
AC
4.1.0 released
KJL