Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
aggielaughs #1
Login/Applicationtoken/Session Variable Problem
I am having a problem with Logging in and Session variables. I am new to
ColdFusion, but program in other languages including PHP and Java. Recently I
got a new job and had to learn ColdFusion, I really like many of the things it
can do with ease, but I'm stumped on a problem the previous programmer did not
fix before he left.
We use MX 6.1, Apache authentication and a query to get user roles in a
modified Mach II framework. The problem is when we update frequently in
develpment we get CFUSERNAME is undefined in SESSION. I'm honestly not
completely sure why this is happening, but if we increment the applicationtoken
by one it works again for awhile.
Below is the login code we are using:
<!--- login handling code --->
<cflogin applicationtoken="dgf_dev_196">
<!--- cflogin should be available once you are apache authenticated --->
<cfif IsDefined("cflogin")>
<!--- get roles for login name --->
<cfstoredproc
procedure="INTRA.WEB_INTRA_CONFIG.getRoles"
datasource="intra_dev">
<cfprocparam dbvarname="username" cfsqltype="cf_sql_varchar"
value="#cflogin.name#">
<cfprocresult name="temproles">
</cfstoredproc>
<cfset request.roles=ValueList(temproles.roles)>
<cfif request.roles neq 0>
<!--- set cfusion login setup --->
<cfloginuser
name="#cflogin.name#"
password="#cflogin.password#"
roles="#request.roles#">
<cfset session.cfpassword="#cflogin.password#">
<cfset session.cfusername="#cflogin.name#">
</cfif>
<!--- this should never happen if Apache .htaccess security is working --->
<cfelse>
<cfinclude
template="/CF-INF/cftemplates/dev/Security/notAuthorized_view.cfm">
</cfif>
</cflogin>
aggielaughs Guest
-
session variable problem
I have a Session object set on Session_Start... I figured out that the object is never created... Cannot understand why.. Also I noticed that... -
ASP SQL Server Database Login - Session Variable
Hello, I have a tough one for you guys. (Atleast I've been pulling my hair out trying to figure this one out.) Thanks for taking a look at this... -
session problem - login screen continually reloads after pressing the login button
I am trying to get sessions to work on a log in screen to give certain users access to certain pages/directories. The problem is that when the... -
[PHP] Session and Server variable problem
Thanks, but no. On the page not setting the cookie and the php.ini isn't setting it to either. But the .ini isn't setting it at all. Could I put... -
Session and Server variable problem
Hi all, Have an interesting problem. Worked on a web site for a client. They have the server (IIS) set up and we are using php. Have been... -
MikerRoo #2
Re: Login/Applicationtoken/Session Variable Problem
There are a few updates and technotes that cover this. Be especially aware of
any CFLOCATION calls that you may make after setting session variables.
We ended up writing a check, on the first call to a session var, that bounces
the user back to the login screen if the session var is missing (we wrote this
before some of Macromedia's fixes and it works darn well).
The updates can be found at:
[url]http://www.macromedia.com/support/coldfusion/technotes.html[/url]
Cheers,
-- MikeR
MikerRoo Guest
-
aggielaughs #3
Re: Login/Applicationtoken/Session Variable Problem
Thanks! This has been driving us/me nuts for some time now. You're a life saver!
aggielaughs Guest



Reply With Quote

