lanmind Posted October 5, 2008 Share Posted October 5, 2008 See this simple page: http://www.dockhawk.com/html.html To me it seems the session value isn't being passed (on my browser at least). Any idea why? PHP: <?php session_start(); // get token variables $token_session = $_SESSION['token']; $token_url = $_GET['token']; // compare them $comparison = $token_session == $token_url; // set the token to a new value to ensure it is only used once. $_SESSION['token'] = uniqid(md5(microtime()), true); echo 'Token in session [' . $token_session .']<br>'; echo 'Token from URL [' . $token_url . ']<br><br>'; echo 'Are they equal? ' . ($comparison ? 'Yes' : 'No') . '.<br>'; if (!$comparison) { die('Invalid token.'); } else { echo 'Valid token.'; } ?> Link to comment https://forums.phpfreaks.com/topic/127092-solved-session-not-passing-in-url/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.