User Tools

Site Tools


libraries:cookiehandler:cookiehandlerclass:readjsoncontent

CookieHandler::ReadJsonContent()


Definition

Returns the JSON-String in the cookie's content as associative array.

Array ReadJsonContent ()

Returns

  • Array
    Content of the cookie converted from JSON-Text to an associative Array

Exception

  • CookieHandlerException:EC_READERROR (104)
    The cookie's content couldn't be read, converted or cookie doesn't exist

Example

$Cookie = new CookieHandler ("Testcookie");
 
$UserArray = array (
   "name" => "Mr. Smith",
   "age"  => 20
   );
 
$UserArray2 = null;
 
try 
{
   $UserArray2 = $Cookie->ReadJsonContent ();
}
catch (CookieHandlerException $e)
{
   // [...]
}   
libraries/cookiehandler/cookiehandlerclass/readjsoncontent.txt · Last modified: 2022/12/13 16:15 by michael.pohl