How do I make a variable available throughout an entire site once a person is logged in. For example, throughout the site, the UserName and Password values are used constantly to validate a user and in queries. However, right now I am passing the UserName and Password variables as URL parameters. This means that a user's Password is viewable. Is there anyone I can make it so that once a user has logged in with a UserName and Password, those variables will be created with the values they entered and I can reference to them. Can I use Application.cfm? I thought about passing them as hidden form values, but this is tough. Here is my login code (you can see how the UserName and Password form values are passed through the URL--and how every template references to those URL values--is there any way to conceal them or reference to them globally?):
==============================================
<html>
<head>
<title>ZEAL network's GATSBY: Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF">
<cfif isDefined("Form.UserName"
>
<cfset TimeOut = "#Now()#">
<cfquery datasource="LHS" name="Check">
SELECT * FROM users WHERE UserName = '#Form.UserName#' AND Password = '#Form.Password#'
</cfquery>
<cfif #Check.RecordCount# IS 0>
<!--- If we have an invalid request --->
<cfinclude template="includes/header.html">
<H4><FONT FACE="Arial, Helvetica, sans-serif">Sorry, the UserName and/or Password
combination you have entered is not correct. Please <A HREF="javascript:history.go(-1)">go
back and try again</A> or <A HREF="tools/send_password/index.cfm">have your
password e-mailed to you</A>.</FONT></H4>
<cfinclude template="includes/footer.html">
<cfelse>
<!--- Or there must have at least one match --->
<cfset Session.Auth = "Yes">
<cfset Session.Admin = "Form.UserName">
<cflocation url="index.cfm?UserName=#Form.UserName#&Password=#Form.Password#" addtoken="Yes">
</cfif>
<cfelse>
<font face="arial">
<cfinclude template="includes/header.html">
<H2>
<u>Login</u></H2></font>
<font face="arial"><FONT SIZE="2"><B>TIP:</B><I> Throughout GATSBY you will see
small question marks next to some options. Click them for specific help at any
time.</I></FONT></font><font face="arial"><cfoutput> <font size="2">
<cfform method="post" action="login.cfm">
</cfform>
</font></cfoutput><cfoutput><font size="2">
<cfform method="post" action="login.cfm">
<TABLE BORDER="0" WIDTH="50">
<TR>
<TD HEIGHT="2" WIDTH="11"><I><B><FONT SIZE="2" FACE="Arial, Helvetica, sans-serif"><A HREF="##" onClick="MM_openBrWindow('help/username.html','','scrollbars=yes,width=200,height=200')">?</A></FONT></B></I></TD>
<TD HEIGHT="2" WIDTH="69"><B><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">UserName:</FONT></B></TD>
<TD HEIGHT="2" WIDTH="16">
<cfinput type="text" name="UserName" REQUIRED="Yes" MESSAGE="A UserName is required.">
</TD>
</TR>
<TR>
<TD HEIGHT="22" WIDTH="11"><I><B><FONT SIZE="2" FACE="Arial, Helvetica, sans-serif"><A HREF="##" onClick="MM_openBrWindow('help/password.html','','scrollbars=yes,width=200,height=200')">?</A></FONT></B></I></TD>
<TD HEIGHT="22" WIDTH="69"><B><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">Password:</FONT></B></TD>
<TD HEIGHT="22" WIDTH="16">
<cfinput type="Password" name="Password" REQUIRED="Yes" MESSAGE="A Password is required.">
</TD>
</TR>
<TR>
<TD HEIGHT="22" COLSPAN="3">
<INPUT TYPE="submit" VALUE="Login" NAME="submit">
</TD>
</TR>
</TABLE>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><a href="tools/update_password/index.cfm">Click
here to change your GATSBY Password.</a><br>
<a href="tools/send_password/index.cfm">Forgot your Password? Use GATSBY's
Password retrieval tool!</a></FONT>
</cfform>
<cfinclude template="includes/footer.html">
</font> </cfoutput> </font>
</cfif>
</body>
</html>
==============================================
Happy Holidays! Thanks in advance.
Ryan ;-]
==============================================
<html>
<head>
<title>ZEAL network's GATSBY: Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF">
<cfif isDefined("Form.UserName"
<cfset TimeOut = "#Now()#">
<cfquery datasource="LHS" name="Check">
SELECT * FROM users WHERE UserName = '#Form.UserName#' AND Password = '#Form.Password#'
</cfquery>
<cfif #Check.RecordCount# IS 0>
<!--- If we have an invalid request --->
<cfinclude template="includes/header.html">
<H4><FONT FACE="Arial, Helvetica, sans-serif">Sorry, the UserName and/or Password
combination you have entered is not correct. Please <A HREF="javascript:history.go(-1)">go
back and try again</A> or <A HREF="tools/send_password/index.cfm">have your
password e-mailed to you</A>.</FONT></H4>
<cfinclude template="includes/footer.html">
<cfelse>
<!--- Or there must have at least one match --->
<cfset Session.Auth = "Yes">
<cfset Session.Admin = "Form.UserName">
<cflocation url="index.cfm?UserName=#Form.UserName#&Password=#Form.Password#" addtoken="Yes">
</cfif>
<cfelse>
<font face="arial">
<cfinclude template="includes/header.html">
<H2>
<u>Login</u></H2></font>
<font face="arial"><FONT SIZE="2"><B>TIP:</B><I> Throughout GATSBY you will see
small question marks next to some options. Click them for specific help at any
time.</I></FONT></font><font face="arial"><cfoutput> <font size="2">
<cfform method="post" action="login.cfm">
</cfform>
</font></cfoutput><cfoutput><font size="2">
<cfform method="post" action="login.cfm">
<TABLE BORDER="0" WIDTH="50">
<TR>
<TD HEIGHT="2" WIDTH="11"><I><B><FONT SIZE="2" FACE="Arial, Helvetica, sans-serif"><A HREF="##" onClick="MM_openBrWindow('help/username.html','','scrollbars=yes,width=200,height=200')">?</A></FONT></B></I></TD>
<TD HEIGHT="2" WIDTH="69"><B><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">UserName:</FONT></B></TD>
<TD HEIGHT="2" WIDTH="16">
<cfinput type="text" name="UserName" REQUIRED="Yes" MESSAGE="A UserName is required.">
</TD>
</TR>
<TR>
<TD HEIGHT="22" WIDTH="11"><I><B><FONT SIZE="2" FACE="Arial, Helvetica, sans-serif"><A HREF="##" onClick="MM_openBrWindow('help/password.html','','scrollbars=yes,width=200,height=200')">?</A></FONT></B></I></TD>
<TD HEIGHT="22" WIDTH="69"><B><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2">Password:</FONT></B></TD>
<TD HEIGHT="22" WIDTH="16">
<cfinput type="Password" name="Password" REQUIRED="Yes" MESSAGE="A Password is required.">
</TD>
</TR>
<TR>
<TD HEIGHT="22" COLSPAN="3">
<INPUT TYPE="submit" VALUE="Login" NAME="submit">
</TD>
</TR>
</TABLE>
<FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><a href="tools/update_password/index.cfm">Click
here to change your GATSBY Password.</a><br>
<a href="tools/send_password/index.cfm">Forgot your Password? Use GATSBY's
Password retrieval tool!</a></FONT>
</cfform>
<cfinclude template="includes/footer.html">
</font> </cfoutput> </font>
</cfif>
</body>
</html>
==============================================
Happy Holidays! Thanks in advance.
Ryan ;-]