Ticket #26: fix-cookie-domain-dont-delete-cookies.diff
| File fix-cookie-domain-dont-delete-cookies.diff, 1.9 KB (added by westi, 2 years ago) |
|---|
-
gp-settings.php
226 226 // So, make all local variables, global 227 227 gp_set_globals( get_defined_vars() ); 228 228 229 /** 230 * It is possible to define this in wp-config.php and it will be used as the domain for all cookies. 231 * Set it carefully for sharing cookies amonst subdomains 232 * 233 * @link http://curl.haxx.se/rfc/cookie_spec.html 234 */ 235 if ( !defined('GP_COOKIE_DOMAIN') ) 236 define('GP_COOKIE_DOMAIN', false); 237 229 238 if ( !class_exists( 'WP_Auth' ) ) { 230 239 require_once( BACKPRESS_PATH . 'class.wp-auth.php' ); 231 240 $cookies = array(); 232 241 $cookies['auth'][] = array( 233 'domain' => isset($_SERVER['HTTP_HOST'])? $_SERVER['HTTP_HOST'] : '',242 'domain' => GP_COOKIE_DOMAIN, 234 243 'path' => gp_url_path(), 235 244 'name' => gp_const_get( 'GP_AUTH_COOKIE', 'glotpress_auth' ), 236 245 ); 237 246 $cookies['secure_auth'][] = array( 238 'domain' => isset($_SERVER['HTTP_HOST'])? $_SERVER['HTTP_HOST'] : '',247 'domain' => GP_COOKIE_DOMAIN, 239 248 'path' => gp_url_path(), 240 249 'name' => gp_const_get( 'GP_SECURE_AUTH_COOKIE', 'glotpress_sec_auth' ), 241 250 'secure' => 'true', 242 251 ); 243 252 244 253 $cookies['logged_in'][] = array( 245 'domain' => isset($_SERVER['HTTP_HOST'])? $_SERVER['HTTP_HOST'] : '',254 'domain' => GP_COOKIE_DOMAIN, 246 255 'path' => gp_url_path(), 247 256 'name' => gp_const_get( 'GP_LOGGED_IN_COOKIE', 'glotpress_logged_in' ), 248 257 ); -
gp-includes/misc.php
82 82 foreach ($_COOKIE as $key => $value ) { 83 83 if ( gp_startswith( $key, $prefix ) && $suffix = substr( $key, strlen( $prefix ) )) { 84 84 GP::$redirect_notices[$suffix] = $value; 85 setcookie( $key, '', 0, gp_url_path() ); 85 86 } 86 setcookie( $key, '', 0, gp_url_path() );87 87 } 88 88 } 89 89
