From 80d063e041a7a201732fe19487b83b196f7846f1 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 25 Dec 2006 11:04:21 +0000 Subject: [PATCH] new param $path for egw_setcookie to optionally specify a path --- phpgwapi/inc/class.sessions.inc.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.sessions.inc.php b/phpgwapi/inc/class.sessions.inc.php index 9a2cea7e02..e2d03fd5ec 100644 --- a/phpgwapi/inc/class.sessions.inc.php +++ b/phpgwapi/inc/class.sessions.inc.php @@ -500,16 +500,19 @@ * Set a cookie * * @param string $cookiename name of cookie to be set - * @param string $cookievalue value to be used, if unset cookie is cleared (optional) - * @param int $cookietime when cookie should expire, 0 for session only (optional) + * @param string $cookievalue='' value to be used, if unset cookie is cleared (optional) + * @param int $cookietime=0 when cookie should expire, 0 for session only (optional) + * @param string $cookiepath=null optional path (eg. '/') if the eGW install-dir should not be used */ - function egw_setcookie($cookiename,$cookievalue='',$cookietime=0) + function egw_setcookie($cookiename,$cookievalue='',$cookietime=0,$cookiepath=null) { if (!$this->cookie_domain || !$this->cookie_path) { $this->egw_set_cookiedomain(); } - setcookie($cookiename,$cookievalue,$cookietime,$this->cookie_path,$this->cookie_domain); + if (is_null($cookiepath)) $cookiepath = $this->cookie_path; + + setcookie($cookiename,$cookievalue,$cookietime,$cookiepath,$this->cookie_domain); } /**