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+cflocation&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]

Reply via email to