Title: chiprogrammerdude's Replies | WordPress.org

---

# chiprogrammerdude

  [  ](https://wordpress.org/support/users/chiprogrammerdude/)

 *   [Profile](https://wordpress.org/support/users/chiprogrammerdude/)
 *   [Topics Started](https://wordpress.org/support/users/chiprogrammerdude/topics/)
 *   [Replies Created](https://wordpress.org/support/users/chiprogrammerdude/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/chiprogrammerdude/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/chiprogrammerdude/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/chiprogrammerdude/engagements/)
 *   [Favorites](https://wordpress.org/support/users/chiprogrammerdude/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wp-blog-header.php killing sessions?](https://wordpress.org/support/topic/wp-blog-headerphp-killing-sessions/)
 *  [chiprogrammerdude](https://wordpress.org/support/users/chiprogrammerdude/)
 * (@chiprogrammerdude)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/wp-blog-headerphp-killing-sessions/#post-610509)
 * I ran into this problem and figured out what was happening.
 * I don’t use wordpress but the guy who does the SEO in my office does use wordpress
   for blogs for the sites i program for him.
 * wordpress natively assumes it’s taking over EVERY aspect of the site since it
   IS a content management system of some kind.
 * this means it naively takes over all and any global variables you have assigned
   for your own php scripts.
 * wp-blog-header.php includes a wp-config.php which also in itself includes a wp-
   settings.php file
 * In wp-settings.php:
 * Look at lines 27 – 47 and then look at line 47 (last line) again.
 * function wp_unregister_GLOBALS() {
    if ( !ini_get(‘register_globals’) ) return;
 *  if ( isset($_REQUEST[‘GLOBALS’]) )
    die(‘GLOBALS overwrite attempt detected’);
 *  // Variables that shouldn’t be unset
    $noUnset = array(‘GLOBALS’, ‘_GET’, ‘_POST’,‘
   _COOKIE’, ‘_REQUEST’, ‘_SERVER’, ‘_ENV’, ‘_FILES’, ‘table_prefix’);
 *  $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset(
   $_SESSION) && is_array($_SESSION) ? $_SESSION : array());
    foreach ( $input as
   $k => $v ) if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) { $GLOBALS[$
   k] = NULL; unset($GLOBALS[$k]); } }
 * wp_unregister_GLOBALS();
 * Session variables ARE global variables. So in effect, its calling the very function
   it just defined to delete ALL global variables.
 * I commented out
    wp_unregister_GLOBALS(); and my sessions are no longer being
   killed.
 * Because I’m not familiar with Word Press, I don’t know what consequences it might
   have to the wordpress stuff deployed on the site. The blogs seem to still work
   but Im gonna have the SEO guy who eats WordPress for breakfast test it.
 * I saw there were no resolutions regarding this subject so I registered to WordPress
   to fill you in on this.
 * I hope this helps.
 * Regards,
    John Yun
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wp-blog-header.php killing sessions?](https://wordpress.org/support/topic/wp-blog-headerphp-killing-sessions/)
 *  [chiprogrammerdude](https://wordpress.org/support/users/chiprogrammerdude/)
 * (@chiprogrammerdude)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/wp-blog-headerphp-killing-sessions/#post-610508)

Viewing 2 replies - 1 through 2 (of 2 total)