Here is the solution that I ended up using and it works really good ...
(good code re-use too!)

<!--- First lets check to see if the customer is logged in --->
   <cfif cookie.customerAuthorized Neq 1>
    <!--- Redirect to login page --->
    <cfset variables.location = "#cgi.script_name#?#cgi.query_string#">
    <cflocation
url="#request.urlRoot##request.relativePath#site/customer_login.cfm?location
=#URLEncodedFormat(variables.location)#" addtoken="no">
   </cfif>

Page code here ....

Works great everytime!!

Thanks for the suggestions, I was following this path, just didn't know if
there was a better way that someone else had stumbled on!

Paul Giesenhagen
QuillDesign


----- Original Message -----
From: "Shawn Grover" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, August 09, 2002 7:44 PM
Subject: RE: Redirection after login


> Ryan Said.....
> Kind of similar to the other posts using CGI vars, but I want to make sure
I
> catch the people that decide to bookmark a certain page in the secured
area
> and therefore do not have a cgi.http_referer variable. Here's an example,
> I'm sure there's a better to do the <cfif> statement - this was done for
> speed's sake:
>
>
> To this I would say that you would ALWAYS have an HTTP_Referer.  Because,
on
> every page (or through Application.cfm - if appropriate for your
> application) you would do a check to see if the user is logged in, and has
> access to the required page.  If not, then you do a redirection to the
login
> page.  At this point, the page you were trying to access IS your referer.
>
> That said, I prefer tacking the target URL onto the URL for the login page
> (encoded of course).
>
> i.e. <cflocation template="/login.cfm?Target=http://mysite/mypage.cfm";>
> (with the actual Target parameter being encoded of course).
>
> Simply because I have seen occasional times where different browser handle
> the CGI variables differently (meaning some handle the HTTP request
headers
> differently).  So sometimes the CGI variables are not accurate - but
> SCRIPT_NAME seems to be VERY standard.
>
> My thoughts....
>
> Shawn Grover
> 
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to