Hmmm, maybe I don't understand the full scope of what you're asking, but
seems like you could do this:

- When a user hits a secure page, redirect to the login page with a URL
variable containing the page they hit (for example, <.cflocation
url="login.cfm?referer=#cgi.script_name#">).

- Pass that URL variable to the form processing page via a hidden form
field.

- If the user is authenticated, use the hidden field to redirect back to the
page they were originally trying to hit.

- If the user is not authenticated, use the hidden field to redirect back to
the login page with the hidden field as a URL variable (starts the whole
process over).

Hope that works for you!

Ryan

-----Original Message-----
From: Mike Kear [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 05, 2001 8:47 AM
To: CF-Talk
Subject: How to find out the page to send 'em back to


I am working on a login system that has so many limitations you couldn't
imagine it.   I want to have the actual login form and processing page as a
single pair of templates in a single location for the whole site.   If any
page requires a user to be logged in, and they're not, they'll be sent to
this page and then sent back to the original page once satisfactorily logged
in against a table in the datasource.

Not so difficult you'd have thought.

So let me put some limitations on there and see if it's still so easy:

No client variables.  Not allowed - all state management has to be in our
site's own datasources
No session variables - it's a clustered environment.
No custom tags permitted


Ok, so I could have the referring page add it's own location to the
parameters passed to the login page.  Except that #cgi.path_info# doesn't
work.  Gives null as a response.

So the login page could use #http_referrer# (which does work)  to specify
where to sent the user back.  But what happens when the login page goes
round fhe second time or third time because  they've put in the wrong
password or something.  It'll only have the correct #http_referrer# the
first time through the page won't it?


Cheers,
Mike Kear
Windsor, NSW, Australia
AFP WebWorks




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to