title: Warning: Illegal string offset 'username' in
body: <p>I am making a user login form for my website and this error pops up <a href="http://i.stack.imgur.com/pIkbI.png" rel="nofollow">Error Message</a> my code is: </p>
  
  <pre><code>&lt;?php if( isset($user) ): ?&gt;
  
      &lt;br /&gt;Welcome &lt;?= $user['username']; ?&gt;
      &lt;br /&gt;&lt;br /&gt;You are successfully logged in!
      &lt;br /&gt;&lt;br /&gt;
      &lt;a href="logout.php"&gt;Logout?&lt;/a&gt;
  
  &lt;?php else: ?&gt;
  
  &lt;h1&gt;Please Login or Regester&lt;/h1&gt;
  &lt;a href="login.php"&gt;Login&lt;/a&gt; or
  &lt;a href="register.php"&gt;Register&lt;/a&gt;
  
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>can someone help me if I need to provide anymore code i will do so to fix this error</p>