The thing is that the variable must always have a value.
<cfquery name="ValidateUser" datasource="#application.D
SELECT *
FROM users
WHERE Username = <cfqueryparam value="#cflogin.Name#" cfsqltype="cf_sql_varchar"
</cfquery>
This query brings up the username, the hash, their id and fullname among other things. So there should always be a value to put into these statements:
<cfset session.User.ID = #ValidateUser.ID#>
<cfset session.User.FullName = #ValidateUser.FullName#>
<cfset session.User.Company = #ValidateUser.Company#>
For some reason if the user doesn't hit the logout key, they stay logged in when they close the browser and open it again. I researched that how to stop that and found that adding this cfif statement:
<cfif IsDefined("Cookie.CFID") AND IsDefined("Cookie.CFTOKEN"
logouts out the user when they close the browser. But when they try to log back in I get a coldfusion error stating that session.User.FullName doesn't exist and it can't create the page because of that.
What seems to be happening from what I can tell is that the session.User.FullName variable is not getting cleared and when it tries to reload it with the #ValidateUser.FullName# value it cannot. So it states that it doesn't exist. This might not be the case, but if it is how can I get the application to reset the value for session.User.FullName so it can load it with a fresh value from the ValidateUser query?
Main Topics
Browse All Topics





by: SidFishesPosted on 2008-10-15 at 07:09:38ID: 22721236
you might just need to use cfparam so the variable is defined (altho no value set)
e" default="">
<cfparam name="session.User.FullNam