Changeset 2543 for trunk/include/functions_cookie.inc.php
- Timestamp:
- Sep 17, 2008, 3:48:31 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_cookie.inc.php
r2339 r2543 37 37 // mod_rewrite is activated for upper level directories. we must set the 38 38 // cookie to the path shown in the browser otherwise it will be discarded. 39 if 40 ( 39 if 40 ( 41 41 isset($_SERVER['PATH_INFO']) and !empty($_SERVER['PATH_INFO']) and 42 42 ($_SERVER['REDIRECT_URL'] !== $_SERVER['PATH_INFO']) and … … 45 45 ) 46 46 { 47 $scr = substr($_SERVER['REDIRECT_URL'], 0, 47 $scr = substr($_SERVER['REDIRECT_URL'], 0, 48 48 strlen($_SERVER['REDIRECT_URL'])-strlen($_SERVER['PATH_INFO'])); 49 49 } … … 65 65 $scr .= '/'; 66 66 } 67 67 68 68 if ( substr(PHPWG_ROOT_PATH,0,3)=='../') 69 69 { // this is maybe a plugin inside pwg directory … … 88 88 * @see pwg_get_cookie_var 89 89 */ 90 function pwg_set_cookie_var($var, $value )90 function pwg_set_cookie_var($var, $value, $expire=null) 91 91 { 92 $_COOKIE['pwg_'.$var] = $value; 93 return 94 setcookie('pwg_'.$var, $value, 95 strtotime('+10 years'), cookie_path()); 92 if ($value==null or $expire===0) 93 { 94 unset($_COOKIE['pwg_'.$var]); 95 return setcookie('pwg_'.$var, false, 0, cookie_path()); 96 97 } 98 else 99 { 100 $_COOKIE['pwg_'.$var] = $value; 101 $expire = is_numeric($expire) ? $expire : strtotime('+10 years'); 102 return setcookie('pwg_'.$var, $value, $expire, cookie_path()); 103 } 96 104 } 97 105
Note: See TracChangeset
for help on using the changeset viewer.