guys thanks a lot for those solutions - don't know what i'd do without this
list sometimes! 

i tried all three methods suggested and measured the average redirect times
(in seconds) of each over ten tries. results:

        Javascript      CFHEADER        META-REFRESH
1       4.2             7.5             4.9
2       6.5             3.4             6.6
3       6.7             5.4             6.8
4       5.7             3.7             6.0
5       4.1             3.5             7.3
6       4.9             20.1            3.4
7       6.8             3.6             5.0
8       4.6             6.0             3.5
9       6.5             4.9             4.2
10      3.9             6.3             5.4
                                
AV      5.39            4.92            5.31

- So times seemed quite similar for all 3 methods (although average for
CFHEADER is discounting the 20.1 as may have been a funny?)
- They varied in effect also: 
        - The JavaScript went straight to a blank page on submission and
showed this until the homepage rendered.
        - The CFHEADER held on the existing form page until the home page
rendered
        - The META-REFRESH actually  executed the rest of the code after the
meta tag, which is desirable because there is some 'you are logged in and
are now being redirected code in there'
- So, given that last point I went for the META method (and CFHEADER method
actually took +20 seconds on two occasions)

Thanks again for the suggestions

_______________________________________________________
*  Regards, 
                Richard Lovelock, 
                Senior Application Analyst.
Westminster City Council - Web Support
Cap Gemini Ernst & Young
Southbank
95 Wandsworth Road
London 
SW8 2HG 
(     0870 906 7482
 
_______________________________________________________


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 20 February 2004 10:29
To: [EMAIL PROTECTED]
Subject: Re: [ cf-dev ] Cookie not working with redirect (CFLOCATION)



try using <cfheader> to redirect:

To set cookies and execute a redirect in the same page, use the cfheader
tag to specify the new target URL; for example:

<cfheader name="location" value="OtherPage.cfm?foo=bar">
<cfheader statusCode="302" statusText="Document Moved">

http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=cfheader+cfcookie+cfl
ocation&btnG=Google+Search


Duncan Cumming
IT Manager

http://www.alienationdesign.co.uk
mailto:[EMAIL PROTECTED]
Tel: 0141 575 9700
Fax: 0141 575 9600

Creative solutions in a technical world

----------------------------------------------------------------------
Get your domain names online from:
http://www.alienationdomains.co.uk
Reseller options available!
----------------------------------------------------------------------
----------------------------------------------------------------------


 

                    "Lovelock,

                    Richard J"               To:     "'cflist'"
<[EMAIL PROTECTED]>                          
                    <richard.lovelock        cc:

                    @cgey.com>               Subject:     [ cf-dev ] Cookie
not working with redirect (CFLOCATION)     
 

                    20/02/2004 10:15

                    Please respond to

                    dev

 

 




Guys need your help...

this is a pretty high profile piece of work which needs to be done for
Monday so would really appreciate any advice

i am a bit stuck on a funny that is occurring.....

- we have a form where a user can log in to the Westminster website
- user enters username password then submits form
- goes to action page, does query to check if user exists in DB
- the next piece of code basically writes a cookie to the client machine
with the 'customerid' retrieved in query
- then straight after does a <CFLOCATION> to the main home-page which tests
for presence of cookie

-- the problem is that the cookie is not being written on to the user's
machine so that the homepage does not recognise them
-- however, if I take out the <CFLOCATION> tag - the cookie gets written OK

-- it is almost as if the page is redirecting to new URL before the cookie
has time to be written - does that sound feasible??
-- is there any way to make the code pause to allow cookie to write before
redirecting or any other solution to this????

CODE IS:

<cfoutput>Start Cookie</cfoutput>



<cfcookie name="customerid"

          value="#pwdcheck.customerid#"

          expires="NEVER"

          domain=".westminster.gov.uk">



<cfoutput><br>End Cookie</cfoutput>

 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office"
/>

<cflocation url="http://www1.westminster.gov.uk/preprod-test-index.cfm";>


_______________________________________________________

*  Regards,
                Richard Lovelock,
                Senior Application Analyst.

Westminster City Council - Web Support
Cap Gemini Ernst & Young
Southbank
95 Wandsworth Road
London
SW8 2HG

(     0870 906 7482

_______________________________________________________




=======================================================
This message contains information that may be privileged or confidential
and is the property of the Cap Gemini Ernst & Young Group. It is intended
only for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy,
disseminate, distribute, or use this message or any part thereof. If you
receive this message in error, please notify the sender immediately and
delete all copies of this message.
=======================================================






-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to