I have a security scheme that checks if users have logged in before letting them access our pages. To make it user-friendly, I have a session variable that holds the desired URL until the user has logged in; once logged in the user is directed to the page they wanted.
The problem comes when the initial URL has URL parameters - the parameters are not included in the redirect and therefore causes errors for the user. The code is below:
This is in a file that is
'd in every file to verify if they have logged in:
In the login file, a session variable is created if the user tried to access a page other than the login screen:
The desired page is /myPage/page.cfm?variable="x", however the cgi.script_name is only "/myPage/page.cfm". Is there a URL parameter variable name comparable to cgi.script_name that I can append to the initial cflocation url?
Thanks in advance,
Jennifer
The problem comes when the initial URL has URL parameters - the parameters are not included in the redirect and therefore causes errors for the user. The code is below:
This is in a file that is
Code:
<cfinclude>
Code:
<cfif session.uid eq "">
<cflocation url="/login/login.cfm?target=#cgi.script_name#" addtoken="No">
</cfif>
In the login file, a session variable is created if the user tried to access a page other than the login screen:
Code:
<cfif IsDefined("URL.target")>
<cflock scope="Session" type="Exclusive" timeout="10">
<cfset session.target=#URL.target#>
</cflock>
</cfif>
The desired page is /myPage/page.cfm?variable="x", however the cgi.script_name is only "/myPage/page.cfm". Is there a URL parameter variable name comparable to cgi.script_name that I can append to the initial cflocation url?
Thanks in advance,
Jennifer