Re: [PHP] Cookie Question
Oops, copy and paste error, that is the cookie I was using to delete. The one I am using to set is acutally: setcookie($szCookieName, $nID, time()+$expireTime,"/","www.mysite.com",false); 2009/1/17 PHP Hi, I am trying to get a cookie to set in Internet Explorer 7, I have tried several different setcookie() configurations, this is the latest. Yes, I read the manual and the user notes, but can't find anything specific about the different security levels in IE. $szCookieName = "MyCookie"; $nID = 2; $expireTime = 60*60; setcookie($szCookieName, $nID, time()-$expireTime,"/",www.mysite.com ,false); is there any reason that you set the expire in the past? That is usually used to delete a cookie, not set it. I had many problems with IE in general, but cookies were never a problem. However, they all work, only if I have the Privacy slider set to low in IE's options. As soon as I go up to medium, it will not work. And it works fine with firefox. The only difference I can see is that Medium Security adds the rule: Restricts first-party cookies that save information that can be used to contact you without your implicit consent. All I am storing is an integer value, why is IE seeing that as information that can contact you? Thanks for any help. Chris -- Torok, Alpar Istvan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookie Question
2009/1/17 PHP > Hi, > I am trying to get a cookie to set in Internet Explorer 7, I have tried > several different setcookie() configurations, this is the latest. > Yes, I read the manual and the user notes, but can't find anything specific > about the different security levels in IE. > > $szCookieName = "MyCookie"; > $nID = 2; > $expireTime = 60*60; > > setcookie($szCookieName, $nID, time()-$expireTime,"/",www.mysite.com > ,false); is there any reason that you set the expire in the past? That is usually used to delete a cookie, not set it. I had many problems with IE in general, but cookies were never a problem. > > > However, they all work, only if I have the Privacy slider set to low in > IE's options. > As soon as I go up to medium, it will not work. > > And it works fine with firefox. > > The only difference I can see is that Medium Security adds the rule: > > Restricts first-party cookies that save information that can be used to > contact you without your implicit consent. > > All I am storing is an integer value, why is IE seeing that as information > that can contact you? > > Thanks for any help. > > Chris -- Torok, Alpar Istvan
Re: [PHP] Cookie Question
Because their clock is set wrong on their computer... Better to set a very long timeout and then handle the expiration yourself. Sorry. On Fri, June 23, 2006 5:26 pm, Tom Ray [Lists] wrote: > I've run into something rather odd with cookies today. I'm working > with > this admin section on a site and I'm setting a cookie that is supposed > to be good for one hour. So in the cookie I have time()+3600 and all > was > well or that was until someone fired up IE. It seems that IE refused > to > set the cookie. After much swearing at IE, I found that if I set it to > time()+7200 the cookie would be set. > > Not if that wasn't odd enough, in Firefox if I logged in at 6PM the > cookie said it would expire at 8PM which is correct. However, when I > logged in via IE at 6PM it said the cookie would expire at 23:00 hours > (11PM for those who don't know)...so my question is...why is this > happening and why does IE do this? I checked in Opera, Mozilla and > Netscape and they all work the same as Firefox. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookie Question
On Saturday 24 June 2006 09:51, John Meyer wrote: > BTW, I have a question: which is the preferred way to handle variables > on the client side: cookies or sessions? Or are there situations where > one should be used and the other should be used in these other situations. If it's a variable that you want the user to be able to hold onto for days, weeks, or months at a time (such as a "remember me" function for blog comments, for example), then use cookies, but NEVER store a username or password, even encrypted, in a cookie. For everything else, use PHP's session handling, particularly the cookie-saved version. Remember, cookies are user-supplied data. That means it is not to be trusted. A session key is hard to hijack, or at least harder than it is to fake a non-random-key cookie. It's easier to hijack if it's in the URL GET string rather than a cookie. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookie Question
On Sat, 2006-06-24 at 10:51, John Meyer wrote: > tedd wrote: > > At 6:26 PM -0400 6/23/06, Tom Ray [Lists] wrote: > >> I've run into something rather odd with cookies today. I'm working with > >> this admin section on a site and I'm setting a cookie that is supposed to > >> be good for one hour. So in the cookie I have time()+3600 and all was well > >> or that was until someone fired up IE. It seems that IE refused to set the > >> cookie. After much swearing at IE, I found that if I set it to time()+7200 > >> the cookie would be set. > >> > >> Not if that wasn't odd enough, in Firefox if I logged in at 6PM the cookie > >> said it would expire at 8PM which is correct. However, when I logged in > >> via IE at 6PM it said the cookie would expire at 23:00 hours (11PM for > >> those who don't know)...so my question is...why is this happening and why > >> does IE do this? I checked in Opera, Mozilla and Netscape and they all > >> work the same as Firefox. > > > > You answered the question yourself, you're testing IE. It sounds like M$ is > > trying to make time to adapt to their standard. > > > > But, you're not alone -- try Google with "IE cookies expiration" > > > > tedd > BTW, I have a question: which is the preferred way to handle variables > on the client side: cookies or sessions? Or are there situations where > one should be used and the other should be used in these other situations. Ummm, how are you implementings sessions? Usually it's done by cookies... or with trans_sid. Either way you shouldn't really be making a distinction here. Unless of course you mean literally storing the data in the client side cookie, versus storing a unique ID there that maps to something in your database or filesystem... in which case go for the latter, but make sure your ID is long enough and random enough to be secure. Usiong PHP's built in session stuff usually works quite well and saves you needing to do the low level work of linking up the cookie with the data. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookie Question
tedd wrote: At 6:26 PM -0400 6/23/06, Tom Ray [Lists] wrote: I've run into something rather odd with cookies today. I'm working with this admin section on a site and I'm setting a cookie that is supposed to be good for one hour. So in the cookie I have time()+3600 and all was well or that was until someone fired up IE. It seems that IE refused to set the cookie. After much swearing at IE, I found that if I set it to time()+7200 the cookie would be set. Not if that wasn't odd enough, in Firefox if I logged in at 6PM the cookie said it would expire at 8PM which is correct. However, when I logged in via IE at 6PM it said the cookie would expire at 23:00 hours (11PM for those who don't know)...so my question is...why is this happening and why does IE do this? I checked in Opera, Mozilla and Netscape and they all work the same as Firefox. You answered the question yourself, you're testing IE. It sounds like M$ is trying to make time to adapt to their standard. But, you're not alone -- try Google with "IE cookies expiration" tedd BTW, I have a question: which is the preferred way to handle variables on the client side: cookies or sessions? Or are there situations where one should be used and the other should be used in these other situations. -- Online library -- http://pueblonative.110mb.com 126 books and counting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookie Question
At 6:26 PM -0400 6/23/06, Tom Ray [Lists] wrote: >I've run into something rather odd with cookies today. I'm working with this >admin section on a site and I'm setting a cookie that is supposed to be good >for one hour. So in the cookie I have time()+3600 and all was well or that was >until someone fired up IE. It seems that IE refused to set the cookie. After >much swearing at IE, I found that if I set it to time()+7200 the cookie would >be set. > >Not if that wasn't odd enough, in Firefox if I logged in at 6PM the cookie >said it would expire at 8PM which is correct. However, when I logged in via IE >at 6PM it said the cookie would expire at 23:00 hours (11PM for those who >don't know)...so my question is...why is this happening and why does IE do >this? I checked in Opera, Mozilla and Netscape and they all work the same as >Firefox. You answered the question yourself, you're testing IE. It sounds like M$ is trying to make time to adapt to their standard. But, you're not alone -- try Google with "IE cookies expiration" tedd -- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookie-question?
Original Message - From: Jose Miguel To: Gustav Wiberg Cc: PHP General Sent: Thursday, September 08, 2005 3:26 AM Subject: Re: [PHP] Cookie-question? Ok, please correct me if i'm wrong... First of all, i'd rather use $_COOKIE instead of $HTTP_COOKIE_VARS. And in the line... if ($voteNow == 'Y' AND $userVote == 'Y' AND $cookieJoke != 'voted') { Why don't you use the operator NOT IDENTICAL (!==), cause != will also return true if the variables are the same type sometimes. On 9/7/05, Gustav Wiberg <[EMAIL PROTECTED]> wrote: Hi there! Look at following code below, and please give me a clue why this cookie-thing doesn't work? $IDJoke is set before and is an ID from a row in a db It seems to work a while, but is there a limit for the expire-parameter? /G http://www.varupiraten.se/ //Get cookie from users computer for current joke to tell if user is allowed to vote or not! // $cookieJoke = $HTTP_COOKIE_VARS["$IDJoke"]; if ($cookieJoke == 'voted') {$showVoteValues ='N';$userVote = 'N';} //User wants to vote? // if ($voteNow == 'Y' AND $userVote == 'Y' AND $cookieJoke != 'voted') { $showVoteValues = 'N'; //Don't show values directly after vote... //Save IDJoke to a cookie with the value - voted to users computer setcookie("$IDJoke", 'voted', time()+60*60*24*30*12*100); /* expires in about 100 years*/ //END User wants to vote // } -- PHP General Mailing List (http://www.php.net/ ) To unsubscribe, visit: http://www.php.net/unsub.php -- Jose Arce http://sinexion.com - http://josearce.com -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.18/91 - Release Date: 2005-09-06 Hi Ok, Thanx for the input! :-) /G http://www.varupiraten.se/
Re: [PHP] Cookie-question?
Ok, please correct me if i'm wrong... First of all, i'd rather use $_COOKIE instead of $HTTP_COOKIE_VARS. And in the line... if ($voteNow == 'Y' AND $userVote == 'Y' AND $cookieJoke != 'voted') { Why don't you use the operator NOT IDENTICAL (!==), cause != will also return true if the variables are the same type sometimes. On 9/7/05, Gustav Wiberg <[EMAIL PROTECTED]> wrote: > > Hi there! > > Look at following code below, and please give me a clue why this > cookie-thing doesn't work? > $IDJoke is set before and is an ID from a row in a db > It seems to work a while, but is there a limit for the expire-parameter? > > /G > http://www.varupiraten.se/ > > > //Get cookie from users computer for current joke to tell if user is > allowed to vote or not! > // > $cookieJoke = $HTTP_COOKIE_VARS["$IDJoke"]; > if ($cookieJoke == 'voted') {$showVoteValues ='N';$userVote = 'N';} > > //User wants to vote? > // > if ($voteNow == 'Y' AND $userVote == 'Y' AND $cookieJoke != 'voted') { > > $showVoteValues = 'N'; //Don't show values directly after > vote... > > //Save IDJoke to a cookie with the value - voted to users > computer > setcookie("$IDJoke", 'voted', time()+60*60*24*30*12*100); /* > expires in about 100 years*/ > > //END User wants to vote > // > } > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Jose Arce http://sinexion.com - http://josearce.com
Re: [PHP] cookie question
* Thus wrote water_foul: > i figured it out ty What did you figure out? People searching the archives would like to know :) > ... > > > > > > On Sat, 19 Jun 2004 15:51:00 -0600, water_foul > > > > > > <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > whats wrong with this script > > > > > > > setcookie('link' . $loopnum . '',$url,time()+3600*200); > > > > > > > setcookie('name' . $loopnum . '',$name,time()+3600*200); > > > > > > > it doesn't write the cookies > > > > > > > Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question...
Angel Freire wrote: First I recomend you to read this page: http://ar.php.net/manual/en/function.setcookie.php I think your recommendtation ought to be http://ar.php.net/manual/ instead. ;-) -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question...
First I recomend you to read this page: http://ar.php.net/manual/en/function.setcookie.php For that example the code should be: $_COOKIE['link1'] El sáb, 19-06-2004 a las 19:47, water_foul escribió: > how do i read a cookie created by this code > setcookie('link1',blah,time()+3600,'/'); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
i figured it out ty "Joel Kitching" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > There are many examples (in the comments) at the manual entry for > set_cookie at php.net; go try one of those. > > On Sat, 19 Jun 2004 16:07:34 -0600, water_foul > <[EMAIL PROTECTED]> wrote: > > > > i did that and it doesn't say that theere there, how do you set cookies so > > that theyy dont expire (maby the expiration is set wrong.. i'm a newb > > with cookies > > > > "Joel Kitching" <[EMAIL PROTECTED]> wrote > > Are you sure you're trying to access them properly, and on the next > > > page refresh? > > > > > > ex) > > > > > > > > // Print an individual cookie > > > echo $_COOKIE["TestCookie"]; > > > echo $HTTP_COOKIE_VARS["TestCookie"]; > > > > > > // Another way to debug/test is to view all cookies > > > print_r($_COOKIE); > > > ?> > > > > > > On Sat, 19 Jun 2004 15:56:36 -0600, water_foul > > > <[EMAIL PROTECTED]> wrote: > > > > > > > > all i did was a function and some conditionals > > > > "Joel Kitching" <[EMAIL PROTECTED]> wrote in message > > > > news:[EMAIL PROTECTED] > > > > > > > > > > > > > Did you do this before you sent some outut? This would send headers, > > > > > therefore causing you to not be able to send the "cookie" header. > > > > > > > > > > On Sat, 19 Jun 2004 15:51:00 -0600, water_foul > > > > > <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > whats wrong with this script > > > > > > setcookie('link' . $loopnum . '',$url,time()+3600*200); > > > > > > setcookie('name' . $loopnum . '',$name,time()+3600*200); > > > > > > it doesn't write the cookies > > > > > > > > > > > > -- > > > > > > PHP General Mailing List (http://www.php.net/) > > > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
There are many examples (in the comments) at the manual entry for set_cookie at php.net; go try one of those. On Sat, 19 Jun 2004 16:07:34 -0600, water_foul <[EMAIL PROTECTED]> wrote: > > i did that and it doesn't say that theere there, how do you set cookies so > that theyy dont expire (maby the expiration is set wrong.. i'm a newb > with cookies > > "Joel Kitching" <[EMAIL PROTECTED]> wrote > Are you sure you're trying to access them properly, and on the next > > page refresh? > > > > ex) > > > > > // Print an individual cookie > > echo $_COOKIE["TestCookie"]; > > echo $HTTP_COOKIE_VARS["TestCookie"]; > > > > // Another way to debug/test is to view all cookies > > print_r($_COOKIE); > > ?> > > > > On Sat, 19 Jun 2004 15:56:36 -0600, water_foul > > <[EMAIL PROTECTED]> wrote: > > > > > > all i did was a function and some conditionals > > > "Joel Kitching" <[EMAIL PROTECTED]> wrote in message > > > news:[EMAIL PROTECTED] > > > > > > > > > > Did you do this before you sent some outut? This would send headers, > > > > therefore causing you to not be able to send the "cookie" header. > > > > > > > > On Sat, 19 Jun 2004 15:51:00 -0600, water_foul > > > > <[EMAIL PROTECTED]> wrote: > > > > > > > > > > whats wrong with this script > > > > > setcookie('link' . $loopnum . '',$url,time()+3600*200); > > > > > setcookie('name' . $loopnum . '',$name,time()+3600*200); > > > > > it doesn't write the cookies > > > > > > > > > > -- > > > > > PHP General Mailing List (http://www.php.net/) > > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
i did that and it doesn't say that theere there, how do you set cookies so that theyy dont expire (maby the expiration is set wrong.. i'm a newb with cookies "Joel Kitching" <[EMAIL PROTECTED]> wrote Are you sure you're trying to access them properly, and on the next > page refresh? > > ex) > > // Print an individual cookie > echo $_COOKIE["TestCookie"]; > echo $HTTP_COOKIE_VARS["TestCookie"]; > > // Another way to debug/test is to view all cookies > print_r($_COOKIE); > ?> > > On Sat, 19 Jun 2004 15:56:36 -0600, water_foul > <[EMAIL PROTECTED]> wrote: > > > > all i did was a function and some conditionals > > "Joel Kitching" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > > > > > Did you do this before you sent some outut? This would send headers, > > > therefore causing you to not be able to send the "cookie" header. > > > > > > On Sat, 19 Jun 2004 15:51:00 -0600, water_foul > > > <[EMAIL PROTECTED]> wrote: > > > > > > > > whats wrong with this script > > > > setcookie('link' . $loopnum . '',$url,time()+3600*200); > > > > setcookie('name' . $loopnum . '',$name,time()+3600*200); > > > > it doesn't write the cookies > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
Are you sure you're trying to access them properly, and on the next page refresh? ex) On Sat, 19 Jun 2004 15:56:36 -0600, water_foul <[EMAIL PROTECTED]> wrote: > > all i did was a function and some conditionals > "Joel Kitching" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > Did you do this before you sent some outut? This would send headers, > > therefore causing you to not be able to send the "cookie" header. > > > > On Sat, 19 Jun 2004 15:51:00 -0600, water_foul > > <[EMAIL PROTECTED]> wrote: > > > > > > whats wrong with this script > > > setcookie('link' . $loopnum . '',$url,time()+3600*200); > > > setcookie('name' . $loopnum . '',$name,time()+3600*200); > > > it doesn't write the cookies > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
sorry i misse dsomething else i should say, this is in the function but i haven't sent any output before i call the function "Water_foul" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > lemme clarify what i mean by function, i created a function > "Water_foul" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > all i did was a function and some conditionals > > "Joel Kitching" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Did you do this before you sent some outut? This would send headers, > > > therefore causing you to not be able to send the "cookie" header. > > > > > > On Sat, 19 Jun 2004 15:51:00 -0600, water_foul > > > <[EMAIL PROTECTED]> wrote: > > > > > > > > whats wrong with this script > > > > setcookie('link' . $loopnum . '',$url,time()+3600*200); > > > > setcookie('name' . $loopnum . '',$name,time()+3600*200); > > > > it doesn't write the cookies > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
lemme clarify what i mean by function, i created a function "Water_foul" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > all i did was a function and some conditionals > "Joel Kitching" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Did you do this before you sent some outut? This would send headers, > > therefore causing you to not be able to send the "cookie" header. > > > > On Sat, 19 Jun 2004 15:51:00 -0600, water_foul > > <[EMAIL PROTECTED]> wrote: > > > > > > whats wrong with this script > > > setcookie('link' . $loopnum . '',$url,time()+3600*200); > > > setcookie('name' . $loopnum . '',$name,time()+3600*200); > > > it doesn't write the cookies > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
all i did was a function and some conditionals "Joel Kitching" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Did you do this before you sent some outut? This would send headers, > therefore causing you to not be able to send the "cookie" header. > > On Sat, 19 Jun 2004 15:51:00 -0600, water_foul > <[EMAIL PROTECTED]> wrote: > > > > whats wrong with this script > > setcookie('link' . $loopnum . '',$url,time()+3600*200); > > setcookie('name' . $loopnum . '',$name,time()+3600*200); > > it doesn't write the cookies > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
Did you do this before you sent some outut? This would send headers, therefore causing you to not be able to send the "cookie" header. On Sat, 19 Jun 2004 15:51:00 -0600, water_foul <[EMAIL PROTECTED]> wrote: > > whats wrong with this script > setcookie('link' . $loopnum . '',$url,time()+3600*200); > setcookie('name' . $loopnum . '',$name,time()+3600*200); > it doesn't write the cookies > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cookie question
Go to your browsers setting and ask the browser to prompt before setting cookies. in IE go to : tools -> Internet Options -> Privacy --> Advanced --> Override automatic cookie handling. See if your page tries to set the cookie at all. If not, try to add : error_reporting(2039); maybe you are sending the headers before you set the cookie. Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: David R [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 11:25 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookie question I tried it that way, and variations on it. I still have had no luck. Any other ideas? Thanks again David R Thanks for you he "Boaz Yahav" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Try setcookie("auth","$val",time() + 3600,"/",".avenew.com"); also look here : http://examples.weberdev.com/get_example.php3?count=67 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: David R [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 9:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookie question I have never read anything about a production server domain. How do I set the cookie for it? Thanks. David R "Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > David R wrote: > > >Hello, > >I have a cookie question. > > > >I have the following code is a file called tc.php > > > > >global $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $settings, $sql ; > >$val="123"; > >setcookie ("auth", $val , time() + 3600); > >$cookie = $HTTP_COOKIE_VARS['auth']; > >echo "cookie is: $cookie"; > >?> > > > >I have no problem retrieving the value cookie value ( 123 ) on my > >local machine but when I post to the internet I can't get the cookie > >value. > > > >Any ideas why? > > > Did you set the cookie for the production server domain? Cookies for > your local machine won't still be there once you upload, you know. > > -- > The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
I tried it that way, and variations on it. I still have had no luck. Any other ideas? Thanks again David R Thanks for you he "Boaz Yahav" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Try setcookie("auth","$val",time() + 3600,"/",".avenew.com"); also look here : http://examples.weberdev.com/get_example.php3?count=67 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: David R [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 9:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookie question I have never read anything about a production server domain. How do I set the cookie for it? Thanks. David R "Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > David R wrote: > > >Hello, > >I have a cookie question. > > > >I have the following code is a file called tc.php > > > > >global $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $settings, $sql ; > >$val="123"; > >setcookie ("auth", $val , time() + 3600); > >$cookie = $HTTP_COOKIE_VARS['auth']; > >echo "cookie is: $cookie"; > >?> > > > >I have no problem retrieving the value cookie value ( 123 ) on my > >local machine but when I post to the internet I can't get the cookie > >value. > > > >Any ideas why? > > > Did you set the cookie for the production server domain? Cookies for > your local machine won't still be there once you upload, you know. > > -- > The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
David R wrote: I have never read anything about a production server domain. How do I set the cookie for it? Same way as for the cookie on your local server, but change the cookie's domain. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cookie question
Try setcookie("auth","$val",time() + 3600,"/",".avenew.com"); also look here : http://examples.weberdev.com/get_example.php3?count=67 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: David R [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 9:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookie question I have never read anything about a production server domain. How do I set the cookie for it? Thanks. David R "Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > David R wrote: > > >Hello, > >I have a cookie question. > > > >I have the following code is a file called tc.php > > > > >global $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $settings, $sql ; > >$val="123"; > >setcookie ("auth", $val , time() + 3600); > >$cookie = $HTTP_COOKIE_VARS['auth']; > >echo "cookie is: $cookie"; > >?> > > > >I have no problem retrieving the value cookie value ( 123 ) on my > >local machine but when I post to the internet I can't get the cookie > >value. > > > >Any ideas why? > > > Did you set the cookie for the production server domain? Cookies for > your local machine won't still be there once you upload, you know. > > -- > The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
I have never read anything about a production server domain. How do I set the cookie for it? Thanks. David R "Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > David R wrote: > > >Hello, > >I have a cookie question. > > > >I have the following code is a file called tc.php > > > > >global $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $settings, $sql ; > >$val="123"; > >setcookie ("auth", $val , time() + 3600); > >$cookie = $HTTP_COOKIE_VARS['auth']; > >echo "cookie is: $cookie"; > >?> > > > >I have no problem retrieving the value cookie value ( 123 ) on my local > >machine but when I post to the internet I can't get the cookie value. > > > >Any ideas why? > > > Did you set the cookie for the production server domain? Cookies for > your local machine won't still be there once you upload, you know. > > -- > The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
David R wrote: Hello, I have a cookie question. I have the following code is a file called tc.php I have no problem retrieving the value cookie value ( 123 ) on my local machine but when I post to the internet I can't get the cookie value. Any ideas why? Did you set the cookie for the production server domain? Cookies for your local machine won't still be there once you upload, you know. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COOKIE Question.
Discovered my cookie issue. I wasn't setting the path in setcookie() so it defaulted to what ever directory the script ran in. I set it so it loads from the root of the website now, and it's working like a charm. Thanks to all that helped! John Holmes wrote: >>I do the print $_COOKIE["Acccess]"; and I still don't see any data >> >> >print. > >Did you typo in your code like you did here?? > >Try to dump the whole $_COOKIE[] array and see what's in it. > >print_r($_COOKIE); > >Did you mention what version of PHP you were using? > >---John Holmes... > > > >
RE: [PHP] COOKIE Question.
> I do the print $_COOKIE["Acccess]"; and I still don't see any data print. Did you typo in your code like you did here?? Try to dump the whole $_COOKIE[] array and see what's in it. print_r($_COOKIE); Did you mention what version of PHP you were using? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COOKIE Question.
> I'm having some issue's with $_COOKIE and $HTTP_COOKIE_VARS, I can't > seem to retrieve data from them. > First I set the cookie like so: > setcookie ("Access", "Test_Value",time()+31536000); Try this: setcookie("Access", "Test_Value",time()+31536000,"/"); - slash as 4th parametr. -- Krzysztof Dziekiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COOKIE Question.
I do the print $_COOKIE["Acccess]"; and I still don't see any data print. Leif K-Brooks wrote: > First of all, the second try should be print $_COOKIE["Access"]; with > no second $. But, more importantly, I would reccomend you change the > cookie name to access. This may not be the problem, but case in names > seems to generally cause problems. > > Tom Ray wrote: > >> I'm having some issue's with $_COOKIE and $HTTP_COOKIE_VARS, I can't >> seem to retrieve data from them. >> >> First I set the cookie like so: >> setcookie ("Access", "Test_Value",time()+31536000); >> >> Then I check my Cookies in Netscape and I can see that I have the >> cookie stored. But when I go to the page that has >> >> print $HTTP_COOKIE_VARS["Access"]; >> print $_COOKIE["$Access"]; >> and even >> print "$Access"; >> >> I don't get the value set in the cookie, and I don't know why...any >> help, please? >> >> > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COOKIE Question.
First of all, the second try should be print $_COOKIE["Access"]; with no second $. But, more importantly, I would reccomend you change the cookie name to access. This may not be the problem, but case in names seems to generally cause problems. Tom Ray wrote: > I'm having some issue's with $_COOKIE and $HTTP_COOKIE_VARS, I can't > seem to retrieve data from them. > > First I set the cookie like so: > setcookie ("Access", "Test_Value",time()+31536000); > > Then I check my Cookies in Netscape and I can see that I have the > cookie stored. But when I go to the page that has > > print $HTTP_COOKIE_VARS["Access"]; > print $_COOKIE["$Access"]; > and even > print "$Access"; > > I don't get the value set in the cookie, and I don't know why...any > help, please? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php