title: opencart redirect same page after login
body: <p>i am new in the opencart. now i have make some category restriction means user must have to login to see that category. so when user click on that category if he is not logged in then he will redirect to the login page. The above process is working fine
  now once i login i want to redirect to the same category page.
  when i come to the login page i can see the value of "$_SERVER['HTTP_REFERER']" is as i want</p>
  
  <pre><code>site.com/index.php?route=product/category&amp;path=62
  </code></pre>
  
  <p>now as i read the tutorial online then told me to change some code in this file "project\catalog\controller\account\login.php"
  i have replace the below code</p>
  
  <pre><code>$this-&gt;redirect($this-&gt;url-&gt;link('account/account', '', 'SSL'));
  </code></pre>
  
  <p>To </p>
  
  <pre><code>if (isset($_SERVER['HTTP_REFERER'])) {
                      $this-&gt;redirect($_SERVER['HTTP_REFERER']);
                  } else {
                      $this-&gt;redirect(HTTPS_SERVER . 'index.php?route=account/account');
                  }
  </code></pre>
  
  <p>when i come to the login page i have right link in the HTTP_REFERER but when i click on the login then it become the login link in referer. so how can i set that ?</p>
  
  <p>can you suggest me how can i do this ?
  i am confused about it.</p>