Hey John,
It depends on how you took the user to the login page to begin with.
If you used a <cfinclude template="login.cfm"><cfabort>,
Then 'yes', the original page request will be the cgi.script_name. (also,
the page in the url that the user sees will also be the same as the
cgi.script_name)
If you used a <cflocation url="login.cfm">, then no, the cgi.script_name
will equal the location and filename for your login page.
I would suggest using a session variable to track what original page that
the user had wanted to visit.
Eg.
1. check to see if logged in
2. not logged in:
Set session.loginredirect = cgi.script_name
[do you login process]
Once the user is logged in
Check to see if session.loginredirect exists, if it does,
redirect the browser to that page, if not, then redirect the browser to your
normal landing page.
3. logged in:
Act as normal
------------------
William E. Seiter
Need to have your mortgage modified?
I charge no fees until I am successful,
then I charge almost half the rate you
would find elsewhere.
Professional. Dedicated. Effective.
The Easy 24/7 way to get started: http://www.goldengrove.net/
or you can call: (626) 593 - 5501
-----Original Message-----
From: John Barrett [mailto:[email protected]]
Sent: Friday, March 06, 2009 10:37 PM
To: cf-newbie
Subject: Re: logout.cfm
Hi Nick,
Thanks:)
By the way does "CGI.SCRIPT_NAME" take you to the page that was denied?
That is if you go to news.cfm but not logged in, then if you log in will
that take you back there?
I am using a file to check the login, but everything is based on the
index.cfm page.
Thanks again,
John
________________________________
From: Eric Nicholas Sweeney <[email protected]>
To: cf-newbie <[email protected]>
Sent: Friday, March 6, 2009 10:28:08 AM
Subject: RE: logout.cfm
John - that should do it... Here is mine - could use some slimming...
<!--- Logout Function --->
<cfif IsDefined("URL. Admin_logout") AND URL.Admin_logout EQ "1">
<cflock scope="Session" type="Exclusive" timeout="30" throwontimeout="no">
<cfset Session.Admin_Username="">
<cfset Session.Admin_UserAuthorization="">
<cfoutput>#structClear(SESSION)#</cfoutput>
</cflock>
<cfset Admin_logoutRedirectPage="login.cfm">
<cfif Admin_logoutRedirectPage EQ "">
<cfset Admin_logoutRedirectPage=CGI.SCRIPT_NAME>
</cfif>
<cfset
Admin_logoutQuery=ListDeleteAt(CGI.QUERY_STRING,ListContainsNoCase(CGI.QUERY
_STRING,"Admin_logout=","&"),"&")>
<cfif Admin_logoutQuery NEQ "">
<cfif Find("?",Admin_logoutRedirectPage) EQ 0>
<cfset Admin_logoutRedirectPage=Admin_logoutRedirectPage & "?" &
Admin_logoutQuery>
<cfelse>
<cfset Admin_logoutRedirectPage=Admin_logoutRedirectPage & "&" &
Admin_logoutQuery>
</cfif>
</cfif>
<cflocation url="#Admin_logoutRedirectPage#" addtoken="no">
</cfif>
- Nick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4432
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15