Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $hasCookie = isset($_COOKIE['TestCookie']);
- echo '<pre>';
- if (!$hasCookie) {
- setcookie('TestCookie', 'test', time() + 86400 * 365);
- echo "Test cookie set; <a href='?a=b'>click here to reload this page to see the result</a>.\n";
- die;
- }
- if ($hasCookie && isset($_REQUEST['TestCookie']))
- echo '$_REQUEST has the cookie, no bug present.';
- else
- echo '$_REQUEST is missing TestCookie, there is a bug.';
- echo "\n\n";
- echo '$_REQUEST:';
- print_r($_REQUEST);
- echo "\n\n";
- echo '$_COOKIE:';
- print_r($_COOKIE);
- echo '</pre>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement