[TYPO3-dev] Set and read cookies

Martin Kutschker masi-no at spam-typo3.org
Sun Jul 13 21:38:06 CEST 2008


Tapio Markula schrieb:
> Hi
> 
> I would need in an extension JS for cookies
> 
> http://www.willmaster.com/library/javascript/set_read_cookies.php
> 
> the problem is that I would nee read cookie for *two-level* array cookie
> but examples seems to handle just one level simple cookies.
> 
> How to create ReadCookie for two-level cookie, for example for this
> 
> 
>     function saveLevel2(value) {
>         var name = "menuCookie[level2Cookie]";
>         var date = new Date();
>         date.setTime(date.getTime()+(24*60*60*1000));
>         var expires = "; expires="+date.toGMTString();
>         document.cookie = name+"="+value+expires+"; path=/";
>     }
>     

I don't get what your problem is. Cookies have just names, there is no
such things like arrays in them. I'm not aware if there is some
restriction so that names may not contain square brackets. So you might
name them this way, but you gain nothing.

Masi




More information about the TYPO3-dev mailing list