Re: Cookie not getting set

From: Date: Mon, 12 May 2003 21:34:58 +0000
Subject: Re: Cookie not getting set
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-147355@lists.php.net to get a copy of this message
James: Thanks for your suggestions- I am aware of the <? ?> issues (which by the way I would have noticed as a problem because I would have got an error about headers already sent, as I have not turned off the error reporting :) ) and as far as the time()+totaltime - yes, I agree with you - but that will not make a difference to the code executing - the actual time string will be time()+31536000 - that that is neither here nor there... Thanks anyhow. So far we have this: <? setcookie("dealercode", "33", time()+60*60*24*365,"/",".vtc.com",0); header('Location: login.php'); ?> And that is it - no spaces b4 or after. I am hoping that someone at another level has an I idea - I have been working PHP for about 3 years now, and I have set millions of cookies - and never had a problem - I am almost convinced that it is something to do with the domains - but I am not familiar enough with how the cookie rules are applied here, and why it would work in some browsers and not others (all browsers tested with are set to accept all cookies....) if it is not a php issue, feel free to tell me to piss off, but if someone has run into this b4 I would appreciate any pointers in the right direction... Thanks again On 5/12/03 5:27 PM, "James" <jh@webcoding.co.uk> wrote: > any gaps before or after the <? ?> wil constitute output beofre headers > being sent and the cookie will not be set. Also, try enclosing the time > equation and more importantly why are you doing those multiplications again > and again, use > > time()+totalTimeAmount! > > > "Mike Morton" <mike@webtraxx.com> wrote in message > news:BAE57D81.FE14%mike@webtraxx.com... >> Sorry - you got a bit of code there that I was trying to work with other >> things, it does not work with .vtc.com any better. >> >> >> >> On 5/12/03 4:29 PM, "Jennifer Goodie" <goodie@apollointeractive.com> > wrote: >> >>> Try putting ".vtc.com" as the domain. >>> >>>> -----Original Message----- >>>> From: Mike Morton [mailto:mike@webtraxx.com] >>>> Sent: Monday, May 12, 2003 1:25 PM >>>> To: php-general@lists.php.net >>>> Subject: [PHP] Cookie not getting set >>>> >>>> >>>> This code works in IE6 PC, but not IE5 or Safari on a Mac: >>>> >>>> setcookie("dealercode", "33", >>>> time()+60*60*24*365,"/","vtc.com",0); >>>> >>>> header('Location: login.php'); >>>> >>>> This code is executed under: >>>> apex.vtc.com >> >> -- >> Cheers >> >> Mike Morton >> >> **************************************************** >> * >> * Tel: 905-465-1263 >> * Email: mike@webtraxx.com >> * >> **************************************************** >> >> "Indeed, it would not be an exaggeration to describe the history of the >> computer industry for the past decade as a massive effort to keep up with >> Apple." >> - Byte Magazine >> >> Given infinite time, 100 monkeys could type out the complete works of >> Shakespeare. Win 98 source code? Eight monkeys, five minutes. >> -- NullGrey >> > > -- Cheers Mike Morton **************************************************** * * Tel: 905-465-1263 * Email: mike@webtraxx.com * **************************************************** "Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple." - Byte Magazine Given infinite time, 100 monkeys could type out the complete works of Shakespeare. Win 98 source code? Eight monkeys, five minutes. -- NullGrey

« previous php.general (#147355) next »