ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

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 }

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

+ 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.

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

References $domain.

◆ getExpires()

Slim_Http_Cookie::getExpires ( )

Get cookie expiration time.

Returns
int UNIX timestamp

Definition at line 141 of file Cookie.php.

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

References $expires.

◆ getHttpOnly()

Slim_Http_Cookie::getHttpOnly ( )

Is cookie sent with HTTP protocol only?

Returns
bool

Definition at line 209 of file Cookie.php.

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

References $httponly.

◆ getName()

Slim_Http_Cookie::getName ( )

Get cookie name.

Returns
string

Definition at line 107 of file Cookie.php.

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

References $name.

◆ getPath()

Slim_Http_Cookie::getPath ( )

Get cookie path.

Returns
string

Definition at line 158 of file Cookie.php.

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

References $path.

◆ getSecure()

Slim_Http_Cookie::getSecure ( )

Is cookie sent only if SSL/HTTPS is used?

Returns
bool

Definition at line 192 of file Cookie.php.

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

References $secure.

◆ getValue()

Slim_Http_Cookie::getValue ( )

Get cookie value.

Returns
string

Definition at line 124 of file Cookie.php.

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

References $value.

◆ setDomain()

Slim_Http_Cookie::setDomain (   $domain)

Set cookie domain.

Parameters
string$domain
Returns
void

Definition at line 184 of file Cookie.php.

184 {
185 $this->domain = (string)$domain;
186 }

References $domain.

Referenced by __construct().

+ 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.

150 {
151 $this->expires = is_string($time) ? strtotime($time) : (int)$time;
152 }

Referenced by __construct().

+ 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.

218 {
219 $this->httponly = (bool)$httponly;
220 }

References $httponly.

Referenced by __construct().

+ 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.

116 {
117 $this->name = (string)$name;
118 }

References $name.

Referenced by __construct().

+ 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.

167 {
168 $this->path = (string)$path;
169 }

References $path.

Referenced by __construct().

+ 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.

201 {
202 $this->secure = (bool)$secure;
203 }

References $secure.

Referenced by __construct().

+ 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.

133 {
134 $this->value = (string)$value;
135 }

References $value.

Referenced by __construct().

+ 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: