That's a great tip. Thanks, Brian. I'll look into it.

On Dec 19, 8:04 pm, brian <zijn.digi...@gmail.com> wrote:
> Just start a session by default for any user. Once the user has logged
> in, create a new session or simply write new values to it.
>
> When the user requests a page, some code of yours must be evaluating
> whether a login is necessary. Ergo, the URL is known to your script.
> So, you can then write the URL to the session and pick it up after
> redirecting to login.
>
> I'm only vaguely familiar with CodeIgiter but CakePHP can do this
> automatically. Perhaps you should check to see if CI has the same
> functionality.
>
>
>
> On Sat, Dec 19, 2009 at 8:42 PM, Vik <v...@mindspring.com> wrote:
> > There is no session yet; the user has not yet logged in. There is no
> > way to write the requested URL to a hidden input in the login form,
> > because the login form isn''t up yet - the user is visiting some other
> > page.
>
> > On Dec 19, 3:58 pm, brian <zijn.digi...@gmail.com> wrote:
> >> 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.

Reply via email to