- see footer for list info -<
Hmmm Ok im obviously missing something here (Like form variables get deleted or something) but just to try a few tests I have this ....

On the page the user is viewing ....

<cfset ReturnURL = cgi.script_name & "?" & cgi.query_string>
<form name="return">
<input type="hidden" name="returnValue" value="#ReturnURL#">
</form>

Which sets the infor in form.returnvalue

On the login page I then have this ...

<cfif isdefined("form.ReturnValue")>
<cfoutput>
return value is - #form.ReturnValue#
</cfoutput>
</cfif>

As you might have guessed nothing appears .... :(

I think maybe the variable gets deleted once the session timer times out?
So do I have to use some other variable type ...?

"My weaknesses just keep getting stronger"

Regards - Paul


From: "Tim Blair" <[EMAIL PROTECTED]>
Reply-To: Coldfusion Development <[email protected]>
To: "Coldfusion Development" <[email protected]>
Subject: RE: [CF-Dev] Can anyone help me withthis please
Date: Fri, 26 Aug 2005 10:28:19 +0100

>- see footer for list info -<

> You could do this by appending the following to all links.
> #UrlEncodedFormat("#script_name#?#query_string#")#

That's close to how we've done it, but instead of using
URLEncodedFormat() we use tobase64() instead (all we're trying to do is
generate a string that can be stuck in the URL, not encrypt it).

When the login page is displayed, if there's a "return" URL var then we
stick that in a hidden form field.  Once the user's logged in, if that
"return" var is set, we simply decode the base64 encoded string and
redirect the user.

Using this method, there's no need to rely on any cookies, database,
session vars or client vars etc.  Example code below -- obviously this
isn't optimsed and will probably require checking on the encoded URL
passed through etc.

<!--- from sessioncheck.cfm --->
<cfif memberNotLoggedIn>
  <cfset thisURL = cgi.script_name & "?" & cgi.query_string>
  <cflocation url="login.cfm?return=#tobase64(thisURL)#">
</cfif>

<!--- from login.cfm --->
<cfif isdefined("url.return")>
  <cflocation url="#tostring(tobinary(attributes.return))#">
</cfif>

Tim.

--
-------------------------------------------------------
Badpen Tech - CF and web-tech: http://tech.badpen.com/
-------------------------------------------------------
    RAWNET LTD - independent digital media agency
    "We are big, we are funny and we are clever!"
     New site launched at http://www.rawnet.com/
-------------------------------------------------------
This message may contain information which is legally
privileged and/or confidential.  If you are not the
intended recipient, you are hereby notified that any
unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such
notification notwithstanding, any comments, opinions,
information or conclusions expressed in this message
are those of the originator, not of rawnet limited,
unless otherwise explicitly and independently indicated
by an authorised representative of rawnet limited.
-------------------------------------------------------
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<


_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to