Skip to content

Instantly share code, notes, and snippets.

@felds
Created June 4, 2016 01:55
Show Gist options
  • Select an option

  • Save felds/b04f866d0e247524cbc8136c8dc45bf7 to your computer and use it in GitHub Desktop.

Select an option

Save felds/b04f866d0e247524cbc8136c8dc45bf7 to your computer and use it in GitHub Desktop.
<?php
session_start();
if ($_COOKIE['current_cookie'] != $_SESSION['prev']) {
die("DENIED");
}
$newcookie = rand(1, 1000);
setcookie('current_cookie', $newcookie);
$_SESSION['prev'] = $newcookie;
sleep(1);
?>
<a href="chcookie.php">Change cookie</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment