- wfDebugLog( 'cookie',
- $func . ': "' . implode( '", "',
- array(
- $options['prefix'] . $name,
- $value,
- $expire,
- $options['path'],
- $options['domain'],
- $options['secure'],
- $options['httpOnly'] ) ) . '"' );
-
- call_user_func( $func,
- $options['prefix'] . $name,
- $value,
- $expire,
- $options['path'],
- $options['domain'],
- $options['secure'],
- $options['httpOnly'] );
+ $cookie = $options['prefix'] . $name;
+ $data = array(
+ (string)$cookie,
+ (string)$value,
+ (int)$expire,
+ (string)$options['path'],
+ (string)$options['domain'],
+ (bool)$options['secure'],
+ (bool)$options['httpOnly'],
+ );
+ if ( !isset( self::$setCookies[$cookie] ) ||
+ self::$setCookies[$cookie] !== array( $func, $data )
+ ) {
+ wfDebugLog( 'cookie', $func . ': "' . implode( '", "', $data ) . '"' );
+ if ( call_user_func_array( $func, $data ) ) {
+ self::$setCookies[$cookie] = array( $func, $data );
+ }
+ } else {
+ wfDebugLog( 'cookie', 'already set ' . $func . ': "' . implode( '", "', $data ) . '"' );
+ }