cflogin returning to login page
I've looked through the code provided on these forums and even copied examples over but my cflogin tag still returns the user back to the login page. When I test cflogin not in the application.cfc file (with the cflogin on a page by itself) it seems to work fine. Can someone provide a second pair of eyes to see where I'm missing something. In the URL it is getting the CFID and CFTOKEN -here's the returned URL after logging in "
mywebsite/home.cfm?CFID=717&CFTOKEN=93369078
This is the application.cfc file:
<cfcomponent>
<cfset This.name = "myapp">
<cfset This.Sessionmanagement="true">
<cfset This.Sessiontimeout="#createtimespan(0,0,30,0)#">
<cfset This.applicationtimeout="#createtimespan(1,0,0,0)#">
<cffunction name="onRequestStart">
<cfargument name = "request" required="true"/>
<cfif IsDefined("Form.logout")>
<cflogout>
</cfif>
<cflogin>
<cfif NOT IsDefined("cflogin")>
<cfinclude template="login.cfm">
it's here
<cfabort>
<cfelse>
<cfquery name="loginQuery" dataSource="#mysource#">
select id,passwd, manager_level from personal
where emplid = '#cflogin.name#'
AND passwd = '#cflogin.password#'
and manager_level <> '8'
</cfquery>
<cfif loginQuery.manager_level NEQ "">
<cfloginuser name="#cflogin.name#" Password = "#cflogin.password#"
roles="#loginQuery.manager_level#">
<cflocation url="home.cfm">
<cfelse>
<cfoutput>
<H2>Your login information is not valid.<br>
Please Try again</H2>
</cfoutput>
<cfinclude template="login.cfm">
<cfabort>
</cfif>
</cfif>
</cflogin>
</cffunction>
</cfcomponent>
And my login form =
<form method="post" action="home.cfm">
ID: <input type="text" name="j_username" size="3" max="11">
password: <input type="text" name="j_password" size="8" max="11">
<input type="submit" name="action" value="Proceed">
