title: Wordpress screwing up PHP Session and form validation token not matching
body: <p>For some reason when it generates a token it stores another token in the session and it is a completely random token.</p>
  
  <p>Here is my code for the Token class - </p>
  
  <pre><code>class Token {
  
  protected static $token;
  
  public static function generate() {
      if(!self::$token){
      self::$token = md5(uniqid());
      }
      return Session::put(Config::get('session/token_name'), self::$token);
  }
  
  
  public static function check($token) {
      $tokenName = Config::get('session/token_name');
  
      if(Session::exists($tokenName) &amp;&amp; $token === Session::get($tokenName)) {
          Session::delete($tokenName);
          return true;
      }
  
      return false;
  }
  } 
  </code></pre>
  
  <p>And here is my code from my Session class -</p>
  
  <pre><code>class Session {
  public static function exists($name) {
      return (isset($_SESSION[$name])) ? true : false;
  }
  
  public static function get($name) {
      return $_SESSION[$name];
  }
  
  public static function put($name, $value) {
      return $_SESSION[$name] = $value;
  }
  
  public static function delete($name) {
      if(self::exists($name)) {
          unset($_SESSION[$name]);
      }
  }
  
  public static function flash($name, $string = null) {
      if(self::exists($name)) {
          $session = self::get($name);
          self::delete($name);
          return $session;
      } else if ($string) {
          self::put($name, $string);
      }
  }
  }
  </code></pre>
  
  <p><code>Config::get('session/token_name')</code> just returns <code>'token'</code></p>
  
  <p>No where else am I generating a new token, and it wouldn't matter anyways as it will just return one token because of the static variable.</p>
  
  <p>Why is WordPress doing this?</p>
  
  <p>Please help I have been trying to get this to work for over 10 straight hours!</p>