title: Google logout using api javascript/jquery
body: <p>In my web application, I allow users to login using the auth command in the API Client Library but I cannot find a Logout option for the Google API JavaScript Client Library.</p>
  
  <p>Can any one suggest how can i Logout of my application as well as google account??</p>
  
  <p>My Login Code is:</p>
  
  <pre><code>var OAUTHURL = 'https://accounts.google.com/o/oauth2/auth?';
  var VALIDURL = 'https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=';
  var SCOPE = 'https://www.googleapis.com/auth/userinfo.profile';
  var CLIENTID = googleAPI;
  var REDIRECT = redirectUrl;
  var TYPE = 'token';
  var _url = OAUTHURL + 'scope=' + SCOPE + '&amp;client_id=' + CLIENTID + '&amp;redirect_uri=' + REDIRECT + '&amp;response_type=' + TYPE;
  var acToken;
  var tokenType;
  var expiresIn;
  var user;
  $('#googleLogin').click(function(){
          var win = window.open(_url, "windowname1", 'width=800, height=600');
  
          var pollTimer = window.setInterval(function () {
              if (win.document.URL.indexOf(REDIRECT) != -1) {
                  window.clearInterval(pollTimer);
                  var url = win.document.URL;
                  acToken = gup(url, 'access_token');
                  tokenType = gup(url, 'token_type');
                  expiresIn = gup(url, 'expires_in');
                  win.close();
  
                  validateToken(acToken);
              }
          }, 100);
  });
  function validateToken(token) {
          $.ajax({
              url: VALIDURL + token,
              data: null,
              success: function (responseText) {
                  getUserInfo();
              },
              dataType: "jsonp"
          });
  }
  </code></pre>