Ok Dan!

Yes the webserver is on another Domain, but that does not explain why my own
machine can still login to the site.

I tested the session state by outputting the variable and it is defined.

On any other client the session is never defined.

Can you recommend a solution round the domain problem.

Thanks Dan.

-----Original Message-----
From: Daniel Lancelot [mailto:[EMAIL PROTECTED]]
Sent: 20 February 2001 10:47
To: CF-Talk
Subject: RE: session variables


Hi John,

What it might be...

Are you switching domains on the live server using cflocation at any time?

If so, any session/application/etc variables may not be set correctly, as CF
needs to set a cookie with CFID/CFTOKEN to identify the client machine, and
cflocate prevents the cookie from being set

This would explain why your not having a problem on the development server,
as:
1/      The cookie will have already been set
2/      Both sections will be under the same domain

HTH

Dan.

-----Original Message-----
From: John McCosker [mailto:[EMAIL PROTECTED]]
Sent: 20 February 2001 10:35
To: CF-Talk
Subject: session variables


Has anyone ever experienced session variables not getting set.

I have created a login page like so,

<cfif isdefined("form.uid") and isdefined("form.pwd")>
                <cfquery name="checkLoginUser"
datasource="#application.dsn#" username="sa" password="ruler">
                SELECT    uid, pwd
                FROM      dbo.Users
                WHERE     (uid = '#form.uid#') and (pwd = '#form.pwd#')
                </cfquery>
                        <cfif checkLoginUser.recordcount eq 1>
                                <cflock scope="session" type="EXCLUSIVE"
timeout="30">
                                        <cfset session.checkLoginUser = 1>
                                        <cfset session.LoginUser =
#checkLoginUser.uid#>
                                </cflock>
                                <cflocation
url="#application.secureVirtualRoot#admin/control.cfm" addtoken="No">
                        <cfelse>
                                <cflock scope="session" type="exclusive"
timeout="30">
                                        <cfset session.checkLoginUser = 0>
                                </cflock>
                        <tr><td bgcolor="#ebebeb" class="main">&nbsp;<font
color="#ff0033">Sorry!</font> but your <b>login</b> details &nbsp;are
<b>incorrect</b> please check!</td></tr>
                        </cfif>
</cfif>


My application file is between the directories in a directory named secure,
and is like so

<cfinclude template="../../application.cfm">
<cfif isdefined("session.checkLoginUser")>
        <cfif session.checkLoginUser neq 1>
                <cflocation
url="#Application.virtualRoot#coolcross/index.cfm" addtoken="No">
        </cfif>
<cfelse>        
        <cflocation addtoken="No"
url="#Application.virtualRoot#coolcross/index.cfm">
</cfif>

When I login through my own client its successfull, the session variable is
set.
If I login on the webserver it is also successful.

If I login on any other client the session never gets set.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to