Overview
  • Namespace
  • Class
  • Tree

Namespaces

  • Modulework
    • Modules
      • Http
        • Exceptions
        • Utilities
  • PHP

Classes

  • Cookie
  • JsonResponse
  • RedirectResponse
  • Request
  • Response

Class Cookie

Cookie Cookie is an OOP way of handling a cookie

Namespace: Modulework\Modules\Http
Located at Modulework/Modules/Http/Cookie.php

Methods summary

public static Modulework\Modules\Http\Cookie
# make( string $name, mixed $value = null, integer $expire = 0, string $path = '/', string $domain = null, boolean $secure = false, boolean $httpOnly = true )

Factory for a cookie

Factory for a cookie

Parameters

$name
string
$name The name of the cookie
$value
mixed
$value The value of the cookie
$expire
integer
$expire The expire date of the cookie (DateTime object possible as well) UNIX timestamp
$path
string
$path The path of where the cookie should be avaible
$domain
string
$domain The domain attribute of the cookie
$secure
boolean
$secure Whether the cookie is SSL only
$httpOnly
boolean
$httpOnly Whether the cookie is HTTP only

Returns

Modulework\Modules\Http\Cookie
A new Cookie instance

Throws

InvalidArgumentException
(from Constructor)
public
# __construct( string $name, mixed $value = null, integer $expire = 0, string $path = '/', string $domain = null, boolean $secure = false, boolean $httpOnly = true )

Constructor.

Constructor.

Parameters

$name
string
$name The name of the cookie
$value
mixed
$value The value of the cookie
$expire
integer
$expire The expire date of the cookie (DateTime object possible as well) UNIX timestamp
$path
string
$path The path of where the cookie should be avaible
$domain
string
$domain The domain attribute of the cookie
$secure
boolean
$secure Whether the cookie is SSL only
$httpOnly
boolean
$httpOnly Whether the cookie is HTTP only

Throws

InvalidArgumentException
public Modulework\Modules\Http\Cookie
# setName( string $name )

Set the cookie' s name

Set the cookie' s name

Parameters

$name
string
$name The name

Returns

Modulework\Modules\Http\Cookie
THIS
public string
# getName( )

Returns the name of the cookie

Returns the name of the cookie

Returns

string
The name
public Modulework\Modules\Http\Cookie
# setValue( mixed $value )

Set the cookie' s value

Set the cookie' s value

Parameters

$value
mixed
$value The value

Returns

Modulework\Modules\Http\Cookie
THIS
public mixed
# getValue( )

Returns the value of the cookie

Returns the value of the cookie

Returns

mixed
The value
public Modulework\Modules\Http\Cookie
# setExpiresTime( string $expire )

Set the cookie' s expire time

Set the cookie' s expire time

Parameters

$expire
string
$expire The expire time

Returns

Modulework\Modules\Http\Cookie
THIS
public integer
# getExpiresTime( )

Returns the expire timestamp (UNIX)

Returns the expire timestamp (UNIX)

Returns

integer
Unix Timestamp
public Modulework\Modules\Http\Cookie
# setPath( string $path )

Set the cookie' s path

Set the cookie' s path

Parameters

$path
string
$path The path

Returns

Modulework\Modules\Http\Cookie
THIS
public string
# getPath( )

Returns the path of the cookie

Returns the path of the cookie

Returns

string
The path
public Modulework\Modules\Http\Cookie
# setDomain( string $domain )

Set the cookie' s domain

Set the cookie' s domain

Parameters

$domain
string
$domain The domain

Returns

Modulework\Modules\Http\Cookie
THIS
public string
# getDomain( )

Returns the domain of the cookie

Returns the domain of the cookie

Returns

string
The domain
public Modulework\Modules\Http\Cookie
# setSecure( boolean $secure )

Set the cookie secure only

Set the cookie secure only

Parameters

$secure
boolean
$secure Whether the cookie is SSL only

Returns

Modulework\Modules\Http\Cookie
THIS
public boolean
# isSecure( )

Checks whether the cookie is SSL only

Checks whether the cookie is SSL only

Returns

boolean
Whether the cookie is "secure"
public
# setHttpOnly( boolean $httpOnly )

Set the cookie HTTP only

Set the cookie HTTP only

Parameters

$httpOnly
boolean
$httpOnly Whether the cookie is HTTP only
public boolean
# isHttpOnly( )

Checks whether the cookie is HTTP only

Checks whether the cookie is HTTP only

Returns

boolean
Whether the cookie is HTTP only
public boolean
# stillExists( )

Checks if the cookie still exists on the client side (Only checks timestamp, not whether the client deleted the cookie)

Checks if the cookie still exists on the client side (Only checks timestamp, not whether the client deleted the cookie)

Returns

boolean
Whether the cookie "could" exists on the client side

Magic methods summary

Properties summary

protected string $name
#

The name of the cookie

The name of the cookie

protected mixed $value
#

The value of the cookie

The value of the cookie

protected string|null $domain
#

The domain attribute of the cookie

The domain attribute of the cookie

protected integer $expire
#

The expire date of the cookie

The expire date of the cookie

protected string $path
#

The path of where the cookie should be avaible

The path of where the cookie should be avaible

protected boolean $secure
#

Whether the cookie is SSL only

Whether the cookie is SSL only

protected boolean $httpOnly
#

Whether the cookie is HTTP only

Whether the cookie is HTTP only

API documentation generated by ApiGen 2.8.0