title: Google Login Session in Php
body: <p>I programmed a Google Login for my website. The user needs to use his or her specific school gmail. However, I run into a problem. If the user accidentally tries to login with another gmail that isn't his school email, the website warns him "You should be using your school gmail" and brings him back to the login page. However, if he tries to click "Login with Google" again (because ideally he would pick the correct Google email address), the session for his previous Google account is still running and doesn't even give him an option to try his other gmail account. I don't know exactly what to do...do I destroy the session? Does the user have to manually log out? Here is the error handling code. </p>
  
  <pre><code>    unset($_SESSION['token']);
      $authUrl = $client-&gt;createAuthUrl();
      echo ("&lt;SCRIPT LANGUAGE='JavaScript'&gt;
          window.alert('You need to login with your school Google account.')
          window.location.href='http://websitename.com/login';
          &lt;/SCRIPT&gt;");
  </code></pre>