aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/session.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/session.php')
-rw-r--r--phpBB/includes/session.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 1f62abc93d..f839b1324f 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -872,7 +872,11 @@ class session
/**
* Sets a cookie
*
- * Sets a cookie of the given name with the specified data for the given length of time.
+ * Sets a cookie of the given name with the specified data for the given length of time. If no time is specified, a session cookie will be set.
+ *
+ * @param string $name Name of the cookie, will be automatically prefixed with the phpBB cookie name. track becomes [cookie_name]_track then.
+ * @param string $cookiedata The data to hold within the cookie
+ * @param int $cookietime The expiration time as UNIX timestamp. If 0 is provided, a session cookie is set.
*/
function set_cookie($name, $cookiedata, $cookietime)
{
@@ -882,7 +886,7 @@ class session
$expire = gmdate('D, d-M-Y H:i:s \\G\\M\\T', $cookietime);
$domain = (!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain'];
- header('Set-Cookie: ' . $name_data . '; expires=' . $expire . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . '; HttpOnly', false);
+ header('Set-Cookie: ' . $name_data . (($cookietime) ? '; expires=' . $expire : '') . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . '; HttpOnly', false);
}
/**