mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-14 04:42:04 +02:00
[ticket/16174] Add core.set_cookie
PHPBB3-16174
This commit is contained in:
parent
9217b85c68
commit
6b85faf7da
@ -1077,7 +1077,7 @@ class session
|
||||
*/
|
||||
function set_cookie($name, $cookiedata, $cookietime, $httponly = true)
|
||||
{
|
||||
global $config;
|
||||
global $config, $phpbb_dispatcher;
|
||||
|
||||
// If headers are already set, we just return
|
||||
if (headers_sent())
|
||||
@ -1085,6 +1085,22 @@ class session
|
||||
return;
|
||||
}
|
||||
|
||||
$disable_cookie = false;
|
||||
/**
|
||||
* Event to disable setting cookie
|
||||
*
|
||||
* @event core.set_cookie
|
||||
* @var bool disable_cookie Set to true to disable setting this cookie
|
||||
* @since 3.2.9-RC1
|
||||
*/
|
||||
$vars = array('disable_cookie');
|
||||
extract($phpbb_dispatcher->trigger_event('core.set_cookie', compact($vars)));
|
||||
|
||||
if ($disable_cookie)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$name_data = rawurlencode($config['cookie_name'] . '_' . $name) . '=' . rawurlencode($cookiedata);
|
||||
$expire = gmdate('D, d-M-Y H:i:s \\G\\M\\T', $cookietime);
|
||||
$domain = (!$config['cookie_domain'] || $config['cookie_domain'] == '127.0.0.1' || strpos($config['cookie_domain'], '.') === false) ? '' : '; domain=' . $config['cookie_domain'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user