title: Redirect user if username matches my cookie token? PHP/MySQL
body: <p>I used to have cookies which were unencrypted so the following code worked fine:</p>
  
  <pre><code>$username = $_REQUEST['username'];
  if ( $username == $_SESSION['loggedin'] ) { 
  echo "&lt;META HTTP-EQUIV=Refresh CONTENT=\"0; URL='/profile.html'\"&gt;";
  } else {
  </code></pre>
  
  <p>However now my cookies work on a MySQL encrypted cookie token basis. I need to basically detect if the username/profile you're trying to access is the same as the one matching your cookie token then it redirects you to /profile.html. I'm not quite sure how to do it? Any suggestions or  help? I've looked online but can't seem to find the solution.</p>