ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Slim_Http_Cookie Class Reference
+ Collaboration diagram for Slim_Http_Cookie:

Public Member Functions

 __construct ( $name, $value=null, $expires=0, $path=null, $domain=null, $secure=false, $httponly=false)
 Constructor. More...
 
 getName ()
 Get cookie name. More...
 
 setName ( $name)
 Set cookie name. More...
 
 getValue ()
 Get cookie value. More...
 
 setValue ( $value)
 Set cookie value. More...
 
 getExpires ()
 Get cookie expiration time. More...
 
 setExpires ( $time)
 Set cookie expiration time. More...
 
 getPath ()
 Get cookie path. More...
 
 setPath ( $path)
 Set cookie path. More...
 
 getDomain ()
 Get cookie domain. More...
 
 setDomain ( $domain)
 Set cookie domain. More...
 
 getSecure ()
 Is cookie sent only if SSL/HTTPS is used? More...
 
 setSecure ( $secure)
 Set whether cookie is sent only if SSL/HTTPS is used. More...
 
 getHttpOnly ()
 Is cookie sent with HTTP protocol only? More...
 
 setHttpOnly ( $httponly)
 Set whether cookie is sent with HTTP protocol only. More...
 

Protected Attributes

 $name
 
 $value
 
 $expires
 
 $path
 
 $domain
 
 $secure
 
 $httponly
 

Detailed Description

Definition at line 42 of file Cookie.php.

Constructor & Destructor Documentation

◆ __construct()

Slim_Http_Cookie::__construct (   $name,
  $value = null,
  $expires = 0,
  $path = null,
  $domain = null,
  $secure = false,
  $httponly = false 
)

Constructor.

Parameters
string$nameThe cookie name
string$valueThe cookie value
mixed$timeThe duration of the cookie; If integer, should be a UNIX timestamp; If string, converted to UNIX timestamp with strtotime;
string$pathThe path on the server in which the cookie will be available on
string$domainThe domain that the cookie is available to
bool$secureIndicates that the cookie should only be transmitted over a secure HTTPS connection from the client
bool$httponlyWhen TRUE the cookie will be made accessible only through the HTTP protocol
Returns
void

Definition at line 93 of file Cookie.php.

References $domain, $expires, $httponly, $name, $path, $secure, $value, setDomain(), setExpires(), setHttpOnly(), setName(), setPath(), setSecure(), and setValue().

93  {
94  $this->setName($name);
95  $this->setValue($value);
96  $this->setExpires($expires);
97  $this->setPath($path);
98  $this->setDomain($domain);
99  $this->setSecure($secure);
100  $this->setHttpOnly($httponly);
101  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getDomain()

Slim_Http_Cookie::getDomain ( )

Get cookie domain.

Returns
string

Definition at line 175 of file Cookie.php.

References $domain.

175  {
176  return $this->domain;
177  }

◆ getExpires()

Slim_Http_Cookie::getExpires ( )

Get cookie expiration time.

Returns
int UNIX timestamp

Definition at line 141 of file Cookie.php.

References $expires.

141  {
142  return $this->expires;
143  }

◆ getHttpOnly()

Slim_Http_Cookie::getHttpOnly ( )

Is cookie sent with HTTP protocol only?

Returns
bool

Definition at line 209 of file Cookie.php.

References $httponly.

209  {
210  return $this->httponly;
211  }

◆ getName()

Slim_Http_Cookie::getName ( )

Get cookie name.

Returns
string

Definition at line 107 of file Cookie.php.

References $name.

107  {
108  return $this->name;
109  }

◆ getPath()

Slim_Http_Cookie::getPath ( )

Get cookie path.

Returns
string

Definition at line 158 of file Cookie.php.

References $path.

158  {
159  return $this->path;
160  }

◆ getSecure()

Slim_Http_Cookie::getSecure ( )

Is cookie sent only if SSL/HTTPS is used?

Returns
bool

Definition at line 192 of file Cookie.php.

References $secure.

192  {
193  return $this->secure;
194  }

◆ getValue()

Slim_Http_Cookie::getValue ( )

Get cookie value.

Returns
string

Definition at line 124 of file Cookie.php.

References $value.

124  {
125  return $this->value;
126  }

◆ setDomain()

Slim_Http_Cookie::setDomain (   $domain)

Set cookie domain.

Parameters
string$domain
Returns
void

Definition at line 184 of file Cookie.php.

References $domain, and string.

Referenced by __construct().

184  {
185  $this->domain = (string)$domain;
186  }
Add rich text string
The name of the decorator.
+ Here is the caller graph for this function:

◆ setExpires()

Slim_Http_Cookie::setExpires (   $time)

Set cookie expiration time.

Parameters
string|intCookie expiration time
Returns
void

Definition at line 150 of file Cookie.php.

Referenced by __construct().

150  {
151  $this->expires = is_string($time) ? strtotime($time) : (int)$time;
152  }
+ Here is the caller graph for this function:

◆ setHttpOnly()

Slim_Http_Cookie::setHttpOnly (   $httponly)

Set whether cookie is sent with HTTP protocol only.

Parameters
bool$httponly
Returns
void

Definition at line 218 of file Cookie.php.

References $httponly.

Referenced by __construct().

218  {
219  $this->httponly = (bool)$httponly;
220  }
+ Here is the caller graph for this function:

◆ setName()

Slim_Http_Cookie::setName (   $name)

Set cookie name.

Parameters
string$name
Returns
void

Definition at line 116 of file Cookie.php.

References $name, and string.

Referenced by __construct().

116  {
117  $this->name = (string)$name;
118  }
Add rich text string
The name of the decorator.
+ Here is the caller graph for this function:

◆ setPath()

Slim_Http_Cookie::setPath (   $path)

Set cookie path.

Parameters
string$path
Returns
void

Definition at line 167 of file Cookie.php.

References $path, and string.

Referenced by __construct().

167  {
168  $this->path = (string)$path;
169  }
Add rich text string
The name of the decorator.
+ Here is the caller graph for this function:

◆ setSecure()

Slim_Http_Cookie::setSecure (   $secure)

Set whether cookie is sent only if SSL/HTTPS is used.

Parameters
bool$secure
Returns
void

Definition at line 201 of file Cookie.php.

References $secure.

Referenced by __construct().

201  {
202  $this->secure = (bool)$secure;
203  }
+ Here is the caller graph for this function:

◆ setValue()

Slim_Http_Cookie::setValue (   $value)

Set cookie value.

Parameters
string$value
Returns
void

Definition at line 133 of file Cookie.php.

References $value, and string.

Referenced by __construct().

133  {
134  $this->value = (string)$value;
135  }
Add rich text string
The name of the decorator.
+ Here is the caller graph for this function:

Field Documentation

◆ $domain

Slim_Http_Cookie::$domain
protected

Definition at line 67 of file Cookie.php.

Referenced by __construct(), getDomain(), and setDomain().

◆ $expires

Slim_Http_Cookie::$expires
protected

Definition at line 57 of file Cookie.php.

Referenced by __construct(), and getExpires().

◆ $httponly

Slim_Http_Cookie::$httponly
protected

Definition at line 77 of file Cookie.php.

Referenced by __construct(), getHttpOnly(), and setHttpOnly().

◆ $name

Slim_Http_Cookie::$name
protected

Definition at line 47 of file Cookie.php.

Referenced by __construct(), getName(), and setName().

◆ $path

Slim_Http_Cookie::$path
protected

Definition at line 62 of file Cookie.php.

Referenced by __construct(), getPath(), and setPath().

◆ $secure

Slim_Http_Cookie::$secure
protected

Definition at line 72 of file Cookie.php.

Referenced by __construct(), getSecure(), and setSecure().

◆ $value

Slim_Http_Cookie::$value
protected

Definition at line 52 of file Cookie.php.

Referenced by __construct(), getValue(), and setValue().


The documentation for this class was generated from the following file: