User Tools

Site Tools


libraries:cookiehandler:cookiehandlerclass:setname

CookieHandler::SetName()


Definition

Sets the name of the cookie to write/read, if it should differ from the one set in the Constructor __construct().

void SetName ( $Name )

Parameters

  • $Name String
    Name of the cookie to write/read. Empty names are not allowed.

Exceptions

  • CookieHandlerException::EC_NONAME (101)
    Given name is not valid or empty

Example

$Cookie = new CookieHandler("Testcookie");
$NewName = "Testcookie2";
 
try 
{
   $Cookie->SetName($NewName);
}
catch (CookieHandlerException $e)
{
   echo "Name couldn't be set!";
}
libraries/cookiehandler/cookiehandlerclass/setname.txt · Last modified: 2022/12/13 19:38 by michael.pohl