title: Codeigniter - Store requested url if not logged in
body: <p>In my site, if the session expired or they logged out, they have to log back in, in order to get into the members area. Now for example, if they want to do something like this</p>
  
  <pre><code>http://example.com/site/approve_friend_request/RaNdOmCoDe
  </code></pre>
  
  <p>You are allowed to only finish approving a friend request, for example, inside the members area. But if they are not logged in, they are redirected to (for example)</p>
  
  <pre><code>http://example.com/login_form
  </code></pre>
  
  <p>I want to know what some ideas are to store the requested url and direct them there once they successfully logged in. I have some ideas, but not sure what the best approach would be. Ideally I wouldn't want to store any info in the url, unless it is a good approach:</p>
  
  <pre><code>http://example.com/login_form/redirect_after_loggin/approve_friend_request/RaNdOmCoDe
  </code></pre>
  
  <p>Thanks in advance.</p>