title: Steam OpenID API
body: <p>I want to make Steam login for my site. The only thing I want from Steam is to login, get his username and start a session for that user. I followed a tutorial on YouTube, did basically everything on that video but when I press sign in through Steam I get: example.com/(()%7D.
  Code: </p>
  
  <pre><code>    &lt;?php
     include "includes/apikey.php";
   include "includes/openid.php";
  
  ob_start();
  
  $OpenID = new LightOpenID("http://astral-gaming.com");
  
  session_start();
  
  ?&gt;
  </code></pre>
  
  <p>This is my header. Also, I put this php on the middle of the doc (because I want sign in to appear after all navbar elements:</p>
  
  <pre><code>&lt;?php 
  
  if(!$OpenID-&gt;mode) {
  
  if(isset($_GET['login'])) {
   $OpenID-&gt;identity = "http://steamcommunity.com/openid";
   header("Location: ($OpenID-&gt;authUrl()}");
  }
  
  if(!isset($_SESSION['T2SteamAuth'])) {
   $login = "&lt;li&gt;&lt;a href =\"?login\"&gt;&lt;img src=\"http://steamcommunity-        a.akamaihd.net/public/images/signinthroughsteam/sits_small.png\"/&gt;&lt;/a&gt;&lt;/li&gt;";
   }
  } elseif($OpenID-&gt;mode == "cancel"){
  
  } else {
  
  if(!isset($_SESSION['TF2SteamAuth'])) {
  $_SESSION['TF2SteamAuth'] = $OpenID-&gt;validate() ? $OpenID-&gt;identity: null;
  $_SESSION['TF2SteamID64'] =       str_replace("http://steamcommunity.com/openid/id/", "",     $_SESSION['TF2SteamAuth']);
  
  if($_SESSION['TF2SteamAuth'] !== null) {
  
  $Steam64 = str_replace("http:// (ignore     space)steamcommunity.com/openid/id/", "", $_SESSION['TF2SteamAuth']);
  $profile = file_get_contents("http:// (ignore space) api.steampowered.com/IsteamUser/GetPlayerSummaries/v0002/?key={$api}&amp;steamids=($Steam64)");
  $buffer = fopen("cache/{$steam64}.json", "w+");
  fwrite($buffer, $profile);
  fclose($buffer);
  
  
  }
  
  header("Location: index.php");
  
  }
  
  }
  if(isset($_SESSION['T2SteamAuth'])) {
  
  $login = "&lt;li&gt;&lt;a href =\"?logout\"&gt;Steam LogOut&lt;/a&gt;&lt;/li&gt;";
  }
  
  if(isset($_GET['logout'])) {
  
  unset($_SESSION['T2SteamAuth']);
  unset($_SESSION['T2SteamAuth']);
  header("Location: index.php");
  
  
  }
  </code></pre>