|
static | add_attributes_to_cookie_response_header (string $cookiename, array $attributes) |
| Make sure the given attributes are set on the Set-Cookie response header identified by name=$cookiename.
|
|
static | cookie_response_headers_add_attributes (array $headerstrings, array $cookiestomatch, array $attributes, bool $casesensitive=false) |
| Given a list of HTTP header strings, return a list of HTTP header strings where the matched 'Set-Cookie' headers have been updated with the attributes defined in $attribute - an array of strings.
|
|
static | expire_moodlesession () |
| Forces the expiry of the MoodleSession cookie.
|
|
◆ add_attributes_to_cookie_response_header()
static core\session\utility\cookie_helper::add_attributes_to_cookie_response_header |
( |
string | $cookiename, |
|
|
array | $attributes ) |
|
static |
Make sure the given attributes are set on the Set-Cookie response header identified by name=$cookiename.
This function only affects Set-Cookie headers and modifies the headers directly with the required changes, if any.
- Parameters
-
string | $cookiename | the cookie name. |
array | $attributes | the attributes to set/ensure are set. |
- Return values
-
◆ cookie_response_headers_add_attributes()
static core\session\utility\cookie_helper::cookie_response_headers_add_attributes |
( |
array | $headerstrings, |
|
|
array | $cookiestomatch, |
|
|
array | $attributes, |
|
|
bool | $casesensitive = false ) |
|
static |
Given a list of HTTP header strings, return a list of HTTP header strings where the matched 'Set-Cookie' headers have been updated with the attributes defined in $attribute - an array of strings.
This method does not verify whether a given attribute is valid or not. It blindly sets it and returns the header strings. It's up to calling code to determine whether an attribute makes sense or not.
- Parameters
-
array | $headerstrings | the array of header strings. |
array | $cookiestomatch | the array of cookie names to match. |
array | $attributes | the attributes to set on each matched 'Set-Cookie' header. |
bool | $casesensitive | whether to match the attribute in a case-sensitive way. |
- Return values
-
array | the updated array of header strings. |
◆ expire_moodlesession()
static core\session\utility\cookie_helper::expire_moodlesession |
( |
| ) |
|
|
static |
Forces the expiry of the MoodleSession cookie.
This is useful to force a new Set-Cookie header on the next redirect.
- Return values
-
The documentation for this class was generated from the following file:
- lib/classes/session/utility/cookie_helper.php