Feature #27508

Get value from cookie

Added by Simon Schaufelberger almost 10 years ago. Updated about 8 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:
PHP Version:
Sprint Focus:


At the moment the only possibilty to get a value from a cookie is this:

lib.files = TEXT
lib.files {
    data = global:HTTP_COOKIE_VARS|files

where files is the cookie name.
The problem with this? It does NOT work if "register_long_arrays" in php.ini is off and by the way:
This feature has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.
from: http://php.net/manual/en/ini.core.php

I would like to create a patch for the core which does the following:

add a new item to "function getData" in class.tslib_content.php for example:

case 'cookie' :
    $retVal = $this->getCookie($key);

and then a function which basically does this (of course with more error checking)
function getCookie($key) {
    return $_COOKIE[$key];

any comments on that or shall i commit to gerrit already?


Updated by Oliver Hader almost 10 years ago

Should be working already with

data = global:_COOKIE|files

which will then access $_COOKIE['files']


Updated by Oliver Hader almost 10 years ago

  • Status changed from New to Rejected
  • Assignee set to Oliver Hader
  • Priority changed from Should have to Won't have this time

Updated by Oliver Hader almost 10 years ago

  • Status changed from Rejected to Accepted
  • Priority changed from Won't have this time to Should have

Updated by Dmitry Dulepov almost 10 years ago

I think this should be "Rejected" because there is already a way to do it. If status is "Accepted", the report statys in the list of active bugs (it shouldn't!)


Updated by Simon Schaufelberger over 8 years ago

can be closed since its working well.

it would be good to add this to the documentation since other people are asking this question as well and i even saw a post here:
that says its not even possible which is wrong.


Updated by Armin Vieweg over 8 years ago

I've updated the "correct answer" on stackoverflow :)
It would be nice, if you could edit your answer and put the typoscript in it, as a guy in the comments ask for it.


Updated by Simon Schaufelberger over 8 years ago

sorry, i have deleted my temporary account already ;)


Updated by Stefan Galinski about 8 years ago

  • Status changed from Accepted to Rejected

Also available in: Atom PDF