title: Returning to page from where redirect request is made
body: <p>There are lot of relavent questions with many answets to this but i wanted to know what is the best and suggested method for this.</p>
  
  <p>The question is simple.i wanted to redirect from one page to other when a condition is not met and after this condition became true in the redirected page,return to the same page from where the redirect is requested in a php or jsp page</p>
  
  <p>More relavent example would be : when a user wants to buy a product from a website,when he chooses a product and want to make payment, the site checks whether the user has log in to the site. If not it takes to login page,and after logging in,take the user to the payment page directly rather than some homepage which usually the login page takes to.</p>
  
  <p>There were options like storing sessions and storing the requested url in a session variable and then use this to return to the page.</p>
  
  <p>But my question is to find what is the most suitable standard for this. 
  Detailed answers are appreciated. Thanks in advance.</p>