class CookieTools (View source)

Handy tools to build a cookie

Methods

static CookieInterface
setCookieProperties(CookieInterface $cookie, array $properties, boolean $serialize)

Set content of $cookie from array $properties

static bool
checkDomain(string $domain_name)

Check if domain is valid

Details

static CookieInterface setCookieProperties(CookieInterface $cookie, array $properties, boolean $serialize)

Set content of $cookie from array $properties

Parameters

CookieInterface $cookie
array $properties Array of properties cookie should have in the format [ 'value' => '', 'expire' => '', 'path' => '', 'domain' => '', 'secure' => '', 'httponly' => '' ]
boolean $serialize

Return Value

CookieInterface

Exceptions

Exception

static bool checkDomain(string $domain_name)

Check if domain is valid

Main code from: http://stackoverflow.com/questions/1755144/how-to-validate-domain-name-in-php

Parameters

string $domain_name The domain name to check

Return Value

bool