title: redirect a logged user to a page in joomla
body: <p>I'm doing a form in more page on joomla.</p>
  
  <p>I'd like to do a thing</p>
  
  <p>The user log-in the site. Complete the first page of the form, after when insert the data e click on a button I will be redirect to another page of the form</p>
  
  <p>I tried this code</p>
  
  <pre><code>$user = JFactory::getUser();
    $id = $user-&gt;get('id');
  if(isset($_SESSION['id']))
  {
  header("Location: http://www.mysite/second-page-form");
  exit;
  }
  </code></pre>
  
  <p>But it doesn't work</p>
  
  <p>I can solve it?</p>