Ok, so I've searched and read the posts on this list about CFLOGIN, I've read
Brandon Purcell's power point and read over all the Macromedia documentation.
I'm actually using most of their code, though I've rearranged it to make more
sense in what I'm doing to prove the concept.
In short it works, but seems to loose the session/user once you leave the page
that did the login?? Anyone know what I'm doing wrong? I'm sure it's something
obvious...
I'll get to the nitty gritty here.
Code is laid out as follows and all lives in the same directory:
-----page break-------
&& PageName.cfm
----------------------
CODE HERE
--<<<<<<<<end page>>>>>>>>--
-----page break-------
&& Application.cfc
----------------------
<cfcomponent output="false">
<!--- define application variables --->
<cfset this.name="CFLHD_Intranet" />
<cfset this.sessionmanagement="true" />
<cfset this.setclientcookies="false" />
<cfset this.loginstorage="session">
</cfcomponent>
--<<<<<<<<end page>>>>>>>>--
-----page break-------
&& index.cfm
----------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>CFLHD - Intranet</title>
<cfsetting showdebugoutput="Yes">
</head>
<body>
<cfoutput>
<h2>Welcome #GetAuthUser()#!</h2><br />
#application.applicationname#><br />
</cfoutput>
<cfif NOT IsDefined("cflogin")>
test not logged in <br />
<cfelse>
test logged in <br />
</cfif>
<cfif GetAuthUser() EQ "">
<a href="LoginForm.cfm">Login</a>
<cfelse>
<cfoutput>
<a href="EmployeeDataPage.cfm?emp_id=#GetAuthUser()#">Nicholas,
Brent</a>
</cfoutput>
</cfif>
</body>
</html>
--<<<<<<<<end page>>>>>>>>--
-----page break-------
&& LoginForm.cfm
----------------------
<H2>Please Log In</H2>
<cfoutput>
<form action="act_LogIn.cfm" method="Post">
<table>
<tr>
<td>username:</td>
<td><input type="text" name="j_username"></td>
</tr>
<tr>
<td>password:</td>
<td><input type="password" name="j_password"></td>
</tr>
</table>
<br>
<input type="submit" value="Log In">
</form>
</cfoutput>
--<<<<<<<<end page>>>>>>>>--
-----page break-------
&& act_LogIn.cfm
----------------------
<cflogin applicationtoken="#application.applicationname#">
<cfif cflogin.name IS "" OR cflogin.password IS "">
<cfoutput>
<h2>You must enter text in both the User Name and Password
fields.</h2>
</cfoutput>
<cfinclude template="loginform.cfm">
<cfabort>
<cfelse>
<!--- remove for simplicity
<cfquery name="loginQuery" dataSource="#request.DATASOURCE#">
SELECT ID, ROLE, GROUP_NAME
FROM CFL_ADMIN.INTRANET_GROUPS
WHERE USER_NAME = '#cflogin.name#'
AND PASSWORD = '#cflogin.password#'
</cfquery> --->
<cfloginuser name="BNICHOLAS" Password="EggARoll" roles="ThaMan">
<!--- removed for simplicity
<cfif loginQuery.ROLE NEQ "">
<cfloginuser name="#cflogin.name#" Password = "#cflogin.password#"
roles="#loginQuery.ROLE#">
<cfelse>
<cfoutput>
<H2>Your login information is not valid.<br>Please Try again</H2>
</cfoutput>
<cfinclude template="loginform.cfm">
<cfabort>
</cfif> --->
</cfif>
</cflogin>
<cfoutput>
THIS WORKS FINE, SHOWS USER....
<h2>Welcome #GetAuthUser()#!</h2>
THOUGH AFTER YOU CLICK THIS YOU'LL LOOSE THE DATA.....
<a href="index.cfm?#session.urltoken#">index page</a>
</cfoutput>
--<<<<<<<<end page>>>>>>>>--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253180
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4