[TYPO3-dev] Set and read cookies
Tapio Markula
tapio.markula at xetpoint.fi
Mon Jul 14 08:46:18 CEST 2008
Martin Kutschker kirjoitti:
> 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
they support simple cookies - just name *or* array cookies like
name[something] (more levels are not supported)
array cookie is real array.
if you debug array cookie $_COOKIE['menuCookie']
you get as result array and not a string
More information about the TYPO3-dev
mailing list