I would do all of this server-side. Have your PHP script save the requested page in the session before redirecting to the login page. Or, write the requested URL to a hidden input in the login form.
On Sat, Dec 19, 2009 at 6:16 PM, Vik <v...@mindspring.com> wrote: > Let's say a user visits my site, and takes an action that requires him > to be logged in. I would like to: > > - Take him to the login page > - Automatically return to the page he started from after he logs in > > So I need to capture the current window.location, which is easy (var > returnURL = window.location) and communicate it to my app. I can't > use URL variables (e.g. ?returnURL=http://www.returnlocation.com), > because I'm using CodeIgniter, so I need to pass the returnURL in a > POST or REQUEST variable. > > Is there a way to do this? > > Thanks in advance to all for any info. >