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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Caching Problem 1

Status
Not open for further replies.

peter11

Instructor
Mar 16, 2001
334
US
I am using a CFM login page. The user enters a username and password and gains access to the site. The problem is that the server (the XP or the Coldfusion Server) caches the users name and password.
When the next person logs on (from s different computer) they get the information from the previous user?

Is there a setting in the Coldfusion Administrator to prevent this?
 
not a coldfusion issue. its the browser. (unless you programmed the script to remembers that information and display it...)

autocomplete="off" can help. stick it in the input tags. ultimatly it's the users / client issue that you have little to no control over.

Even if you names the form fields randomly, well, now you've just stored the username and password autocompletes accros many different field names...





Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
When the next person logs on (from s different computer) they get the information from the previous user
If you're having this problem across multiple computers and browsers, then there's something wrong with the way you have your login script coded. Most likely you're doing something like setting application variables instead of sessions.

Anyway, show us your login script and maybe we can help, or take a look at these FAQs:
faq232-3469 & faq232-5186

Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
I guess I assumed that he would know if he was outputing vairables in his own form :)

Definatly check if you are though! I think it's a browser, autocomplete / save form info issue.

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
Just another thought, and I've done this before, make sure you don't have the Username and Password values hard coded in your login query. Sometimes when testing I'll just hard code the values in instead of using the form values, so no matter what anyone puts in the form, they'll be logged in as the same user.

Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
here is the code
Code:
<cfset uname= #Form.UserName#>
<cfset pass= #Form.Password#>
<!--- Get user's details from the database --->
<cfquery name="GetUser" datasource="login">
SELECT	firstname, realname, title, password, username, passid, school, lastip, totallogins, lastbrowser, lastlogin, department
FROM 	Users
WHERE	UserName 	= '#uname#'
AND 	Password 	= '#Pass#'
</cfquery>


<!--- Check if we have a winner! --->
<cfif GetUser.RecordCount gt 0>
<cfset enckey="pe11ter">




	<!--- Store the user id in session variables and cookies. --->
		<cfset Session.userID = GetUser.passid>
		<cfset Session.firstname = GetUser.firstname>
		<cfset Session.realname = GetUser.realname>
		<cfset Session.schoolid = GetUser.school>
		<cfset Session.password = GetUser.password>
		<cfset Session.title = GetUser.title>
		<cfset Session.department = GetUser.department>

<!--- If user exists, update his or her profile information --->
<!--- First get the old info - you may wish to use this somehow.  Some of the login stats are --->
<!--- cumulative, so we add to the prior number, like TotalLogins--->
	<cfset oldIP = getUser.LastIP> 
	<cfset oldBrowser = getUser.LastBrowser> 
	<cfset oldLogin = getUser.LastLogin> 
	<cfset TotLogins = getUser.TotalLogins> 

<!--- Store the new info in variables --->
	<cfset newIP = CGI.REMOTE_ADDR>
	<cfset newBrowser = CGI.HTTP_USER_AGENT> 
	<cfset TotLogins = TotLogins + 1> 

	<cfquery Datasource="login" name="UpdateUser"> 
		UPDATE 	Users
		SET 	TotalLogins = #TotLogins#,
				LastIP 		= '#newIP#',
				LastBrowser = '#newBrowser#',
				LastLogin 	= #CreateODBCDateTime(Now())#
		WHERE 	passid = #session.UserID#
	</cfquery> 

<META HTTP-EQUIV=REFRESH CONTENT="0; URL=login2.cfm">
<cfelse>
<!--- User does not exist --->
<!--- Pass the variables back in the URL - message and UserName --->
<cfset loginpage = "index.cfm?Message=" & URLEncodedFormat("Invalid User Name/Password Combination")>
<cfset loginpage = loginpage & "&Name=" & URLEncodedFormat(#Form.UserName#)>
<cflocation url="#loginpage#">
</cfif>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top