Hello all,
I have added login for some admin pages, I am having to login for every page when trying to add a product instead of remembering that i am logged in
heres the code that is included in the application.cfm
I have added login for some admin pages, I am having to login for every page when trying to add a product instead of remembering that i am logged in
heres the code that is included in the application.cfm
Code:
<cflogin>
<cfif CGI.QUERY_STRING IS "">
<cfset FormAction = #CGI.SCRIPT_NAME#>
<cfelse>
<cfset FormAction = "#CGI.SCRIPT_NAME#?#CGI.QUERY_STRING#">
</cfif>
<cfif NOT (IsDefined ("Form.Username") AND IsDefined ("Form.Password"))>
<cfinclude template="login.cfm">
<cfabort>
<cfelse>
<CFQUERY NAME="login" DATASOURCE="y_business">
SELECT business_id,user_name,access_level
FROM login
WHERE (User_name = <cfqueryparam value="#Form.Username#" cfsqltype="CF_SQL_VARCHAR">
AND Password = <cfqueryparam value="#Form.password#" cfsqltype="CF_SQL_VARCHAR">)
</CFQUERY>
<cfif login.RecordCount EQ '1'>
<cfloginuser name="#login.business_id#, #login.user_name#" password="#Form.password#" roles="#trim(login.access_level)#">
<cfelse>
<cfset Invalid = "Yes">
<cfinclude template="login.cfm">
<cfabort>
</cfif>
</cfif>
</cflogin>