Ignore:
Timestamp:
Sep 17, 2008, 3:48:31 AM (16 years ago)
Author:
rvelices
Message:
  • fix status header (web services + IE6 min display)
  • sql optims in feed /notification
  • dont send cookie for 10 years from admin/history.php
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_cookie.inc.php

    r2339 r2543  
    3737    // mod_rewrite is activated for upper level directories. we must set the
    3838    // cookie to the path shown in the browser otherwise it will be discarded.
    39     if 
    40       ( 
     39    if
     40      (
    4141        isset($_SERVER['PATH_INFO']) and !empty($_SERVER['PATH_INFO']) and
    4242        ($_SERVER['REDIRECT_URL'] !== $_SERVER['PATH_INFO']) and
     
    4545      )
    4646    {
    47       $scr = substr($_SERVER['REDIRECT_URL'], 0, 
     47      $scr = substr($_SERVER['REDIRECT_URL'], 0,
    4848        strlen($_SERVER['REDIRECT_URL'])-strlen($_SERVER['PATH_INFO']));
    4949    }
     
    6565    $scr .= '/';
    6666  }
    67  
     67
    6868  if ( substr(PHPWG_ROOT_PATH,0,3)=='../')
    6969  { // this is maybe a plugin inside pwg directory
     
    8888 * @see pwg_get_cookie_var
    8989 */
    90 function pwg_set_cookie_var($var, $value)
     90function pwg_set_cookie_var($var, $value, $expire=null)
    9191{
    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  }
    96104}
    97105
Note: See TracChangeset for help on using the changeset viewer.