Larry Brister
asked on
Secure Page Redirect
Hello,
I've been using the Dreamweaver tools to secure a page. It allows me to redirect to "sorry" page (or whatever) to direct them to login if they try to go directly to the page without logging in.
My login page then sends them to the web's default page on authorization.
What I really want to do is have them sent back to the page they wanted in the first place.
Code below as you can see has a "URL Fail" redirect.
Thanks in advance.
<cflock scope="Session" type="ReadOnly" timeout="30" throwontimeout="no">
<cfset MM_Username=Iif(IsDefined( "Session.M M_Username "),"Sessio n.MM_Usern ame",DE("" ))>
<cfset MM_UserAuthorization=Iif(I sDefined(" Session.MM _UserAutho rization") ,"Session. MM_UserAut horization ",DE(""))>
</cflock>
<cfif MM_Username EQ "">
<cfset MM_referer=CGI.SCRIPT_NAME >
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_referer=MM_referer & "?" & CGI.QUERY_STRING>
</cfif>
<cfset MM_failureURL="../sorry.cf m?accessde nied=" & URLEncodedFormat(MM_refere r)>
<cflocation url="#MM_failureURL#" addtoken="no">
</cfif>
<cfset CurrentPage=GetFileFromPat h(GetTempl atePath()) >
I've been using the Dreamweaver tools to secure a page. It allows me to redirect to "sorry" page (or whatever) to direct them to login if they try to go directly to the page without logging in.
My login page then sends them to the web's default page on authorization.
What I really want to do is have them sent back to the page they wanted in the first place.
Code below as you can see has a "URL Fail" redirect.
Thanks in advance.
<cflock scope="Session" type="ReadOnly" timeout="30" throwontimeout="no">
<cfset MM_Username=Iif(IsDefined(
<cfset MM_UserAuthorization=Iif(I
</cflock>
<cfif MM_Username EQ "">
<cfset MM_referer=CGI.SCRIPT_NAME
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_referer=MM_referer & "?" & CGI.QUERY_STRING>
</cfif>
<cfset MM_failureURL="../sorry.cf
<cflocation url="#MM_failureURL#" addtoken="no">
</cfif>
<cfset CurrentPage=GetFileFromPat
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.