/**
  * Proves that invalid sessions will be destroyed and re-created
  * if invalid
  *
  * @return void
  */
 public function testInvalidSessionRenew()
 {
     TestCakeSession::start();
     $this->assertNotEmpty($_SESSION['Config']);
     $data = $_SESSION;
     session_write_close();
     $_SESSION = null;
     TestCakeSession::start();
     $this->assertEquals($data, $_SESSION);
     TestCakeSession::write('Foo', 'Bar');
     session_write_close();
     $_SESSION = null;
     TestCakeSession::userAgent('bogus!');
     TestCakeSession::start();
     $this->assertNotEquals($data, $_SESSION);
     $this->assertEquals('bogus!', $_SESSION['Config']['userAgent']);
 }
/**
 * test valid with bogus user agent.
 *
 * @return void
 */
	public function testValidBogusUserAgent() {
		Configure::write('Session.checkAgent', true);
		TestCakeSession::start();
		$this->assertTrue(TestCakeSession::valid(), 'Newly started session should be valid');

		TestCakeSession::userAgent('bogus!');
		$this->assertFalse(TestCakeSession::valid(), 'user agent mismatch should fail.');
	}