User Tools

Site Tools


libraries:cookiehandler:cookiehandlerclass:readtextcontent

CookieHandler::ReadTextContent()


Definition

Returns the content set in the cookie with the current name as string.

String ReadTextContent ()

Returns

  • String
    Content of the cookie with the current name.

Exception

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

Example

// Getting the cookie with last visited website
$LastWebsiteCookie = new CookieHandler ("LastWebsite");
// Getting the cookie with last logged in user
$LastUserCookie    = new CookieHandler ("LastUser");
 
$LastWebsiteContent = '';
$LastUserContent    = '';
 
try 
{
   $LastWebsiteContent = $LastWebsiteCookie->ReadTextContent ();
   $LastUserContent    = $LastUserCookie->ReadTextContent ();
}
catch (CookieHandlerException $e)
{
   // [...]
}
libraries/cookiehandler/cookiehandlerclass/readtextcontent.txt · Last modified: 2022/12/13 16:25 by michael.pohl