Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFLOGIN Problem

Status
Not open for further replies.

gbookhout

Programmer
Aug 30, 2004
2
US
Setup: ColdFusion MX, Session variables enabled in ColdFusion administrator, IE6.0 w/ Accept All Cookies set, MS Windows XP Professional

Problem: Name and Role attributes set in cfloginuser are not remembered on pages other than the login page as evidenced by GetAuthUser and IsUserInRole functions not working as expected. This problem occurred in all 3 of the following cases: (1) Application.cfm file with CFAPPLICATION tag with sessionmanagement set to "yes" (2) same as (1) but "no" (3) no Application.cfm file and no CFAPPLICATION tag. Other people at my company have not had this problem. The program below or one very similar worked on another person's machine w/ the same software.

Code:

Application.cfm file:
Code:
<cfapplication name="testingCflogin" sessionmanagement="yes">

page1.cfm file:
Code:
<html>
<head>
</head>
<body>
<h3>Testing cflogin</h3>
 <!--- debugging --->
<cfoutput>
Debugging:<br>
Before login (i.e cfloginuser):<br>
GetAuthUser() returns: "#GetAuthUser()#"<br>
IsUserInRole("corpAdmin") returns: #IsUserInRole("corpAdmin")#<br>
IsUserInRole("officeAdmin") returns: #IsUserInRole("officeAdmin")#<br>
IsUserInRole("employee") returns: #IsUserInRole("employee")#<br>
<br><br>
</cfoutput>

<!--- This block executes only if user has *not* logged in --->
<cflogin>
<!--- Tell ColdFusion to consider user to be logged in --->
<cfloginuser 
       name="vwatts" 
       password="wrotciv"
	   roles = "corpAdmin">
</cflogin>
<!--- debugging --->
<cfoutput>
Debugging:<br>
After login:<br>
Attribute settings in cfloginuser:<br>
Name=vwatts<br>
Password=wrotciv<br>
Roles=corpAdmin<br>
GetAuthUser() returns: "#GetAuthUser()#"<br>
IsUserInRole("corpAdmin") returns: #IsUserInRole("corpAdmin")#<br>
IsUserInRole("officeAdmin") returns: #IsUserInRole("officeAdmin")#<br>
IsUserInRole("employee") returns: #IsUserInRole("employee")#<br>
<br>
</cfoutput>

<cflocation url="page2.cfm">
</body>
</html>

page2.cfm file:

Code:
<html>
<head>
</head>
<body>
<cfoutput>
Debugging:<br>
After login:<br>
Attribute settings in cfloginuser:<br>
Name=vwatts<br>
Password=wrotciv<br>
Roles=corpAdmin<br>
GetAuthUser() returns: "#GetAuthUser()#"<br>
IsUserInRole("corpAdmin") returns: #IsUserInRole("corpAdmin")#<br>
IsUserInRole("officeAdmin") returns: #IsUserInRole("officeAdmin")#<br>
IsUserInRole("employee") returns: #IsUserInRole("employee")#<br>
<br>
</cfoutput>
<cflogout>
</body>
</html>








 
I think that I now know the solution to this problem, but I don't know how to carry it out.

On p. 153 of Ben Forta's book Advanced Macromedia ColdFusion MX Application Development are the sentences:
"Users must allow in-memory cookies in their browsers. If the browser disables cookies, then the effect of the <CFLOGINUSER> tag exists only for the current page request."

But I don't know how to allow in-memory cookies in IE6.0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top