Hello,
Firstly, this should be posted on CFTalk but...
The most obvious cause of your problem is that the database doesn't contain
the uid and pwd you expect it to... So double check they are in there. It
will probably help if you could narrow down which of the 3 cfloactions are
redirecting you, for debugging, you could append ?cflocation=1/2/3 to the
cflocation urls.
Apart from that I can't isolate any other individual problem in your code
that will definatly be causing it to fail on your clients machine but work
on yours, but I can point out some problems with your code that may help you
narrow down the problem.
Firstly, you are using application and session scoped variables without
locking. You should cflock exclusively for writes and readonly for reads. I
would also question your choice of scoped variables. For example, you really
don't want application.dsn to be an application scoped var, it would mean
you would have to readonly lock every single database interaction. Consider
changing it to the request scope instead, the overhead of creating a new var
for every page request will be considerably less than cflocking ever db
interaction.
HTH
--
Ben Lowndes, CF Contractor, London, UK
http://www.lowndes.net/ for code samples, fusebox and more.
Currently available for new contracts.
> Can anyone help with this.
>
> I have created a login page. If login fields are defined it performs a
> record count in the database for the username and password.
>
> as so.
>
> <cfif isdefined("form.uid") and isdefined("form.pwd") and form.uid neq ''
> and form.pwd neq ''>
> <cfquery name="checkLoginUser"
> datasource="#application.dsn#" >
> SELECT uid, pwd
> FROM dbo.Users
> WHERE (uid = ' #form.uid# ') and (pwd = ' #form.pwd# ')
> </cfquery>
> <cfif checkLoginUser.recordcount eq 1>
> <cfset session.checkLoginUser = 1>
>
> <cflocation
> url="#application.secureVirtualRoot#admin/hereWeGo.cfm" addtoken="No">
> <cfelse>
> <cfset session.checkLoginUser = 0>
> and so on...
> </cfif>
> <cfelse>
> and so on...
> </cfif>
>
> in between my login directory and the directory I want to go to, I have a
> secure directory with just this application template in,
>
> <cfinclude template="../../application.cfm">
>
> <cfif isdefined("session.checkLoginUser") and session.checkLoginUser eq 1>
>
> <cfif session.checkLoginUser neq 1>
> <cflocation addtoken="No"
> url="#Application.virtualRoot#coolcross/index.cfm">
> </cfif>
> <cfelse>
> <cflocation addtoken="No"
> url="#Application.virtualRoot#andsoOn/hereWeGo.cfm">
> </cfif>
>
> This is successful on my own machine, but on any other client I connot
> access the secure directory, it always redirects me back to the
> login page.
>
> I have clientmanagement set to no and session variables enabled in cf
> server.
>
> Can anyone help, this is really strange.
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists