This is a bug "Feature/Change Request" I made to:
http://bugs.php.net/bug.php?id=17158
setcookie() states "cookies must be sent before any other headers
are sent (this is a restriction of cookies, not PHP).
I argue this is a restriction of PHP, not cookies.
Here is my proof:
http://www.college
Hello,
I need to set a cookie to store a username, password, and passcode forever
(never expires). I don't really know how to use the setcookie() function.
Could someone show me the proper way to use the setcookie() function to do
this?
Thanks,
Tyler
--
PHP General Mailing List (http://www.p
How can I set cookies during a login for fields in the a table? Example set
cookie for UserID which is a file in the same table. Also how would I
retrieve that info? Thanks in advance...
David Smith
';
}
?>
David Smith
Indy Web Design
http://www.indywebdesign.co
Warning
Could not process message with given Content-Type:
multipart/mixed; boundary="part3af60cf00dceb"
Is there any way to see whether or not the cookie setting has actually
worked without going to another page? I suspect there isn't but I'd like
confirmation ;)
Cheers
Max
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail
Please help...
When we are setting a cookie in a PHP page, that cookie cannot be accessed
by any page in a different folder. When we move the pages into the same
folder, the cookies worked fine. Can anyone shed some light on this??
Here is how we are setting the cookie:
setcookie("cookiename",
PHP is a server-side language and as such it deals with server-side
issues. If you want to write javascript that sets a client-side
Javascript cookie, go ahead. It has nothing to do with PHP and PHP will
certainly not get in your way.
-Rasmus
On Sat, 11 May 2002, jtjohnston wrote:
> This is a
Rasmus
server-side / client-side, that's not the point.
My point is PHP can, could and should be able to set a cookie after HTML is
set.
But of course, Jan has already closed the issue, as usual.
http://bugs.php.net/bug.php?id=17158
> PHP is a server-side language and as such it deals with se
If the issue has pissed you off in tha past,
complain. Vote: http://bugs.php.net/bug.php?id=17158
> Rasmus
> server-side / client-side, that's not the point.
>
> My point is PHP can, could and should be able to set a cookie after HTML is
> set.
> But of course, Jan has already closed the issue,
And you can do so if you turn on output buffering. Having PHP send off
JavaScript to do this is a massive hack that has no place in PHP. Write
your own setcookie wrapper function if that is what you want.
-Rasmus
On Sat, 11 May 2002, jtjohnston wrote:
> Rasmus
> server-side / client-side, tha
You've just pointed out that you're a clueless newbie, that's' all, and
can't read a spec worth a whit.
-Original Message-
From: jtjohnston [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 11, 2002 4:50 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] setcookie()
Ra
On Sat, 11 May 2002, jtjohnston wrote:
> This is a bug "Feature/Change Request" I made to:
> http://bugs.php.net/bug.php?id=17158
>
> setcookie() states "cookies must be sent before any other headers
> are sent (this is a restriction of cookies, not PHP).
>
> I argue this is a restriction of PHP
Hello jtjohnston,
Saturday, May 11, 2002, 11:42:52 PM, you wrote:
j> This is a bug "Feature/Change Request" I made to:
j> http://bugs.php.net/bug.php?id=17158
j> setcookie() states "cookies must be sent before any other headers
j> are sent (this is a restriction of cookies, not PHP).
j> I argu
I'm going over some code handed to me, a logout function:
function user_logout()
{
setcookie( 'user_name', '',(time()+28800), '/', '',0);
setcookie( 'id_hash', '',(time()+28800), '/', '',0);
}
Doesn't this mean the cookie will expire after 8 hrs? So what's this
really doing?
Moreover I fou
what does SetCookie() returns???
I did a var_dump() on it and it gave me 'bool(true)' when in fact the
cookie was not set...
_
. Christian Dechery
. . Gaita-L Owner / Web Developer
. . http://www.webstyle.com.br
. . http://www.tanamesa.com.br
--
PHP General Mailin
ec-01 21:58:55 GMT; path=/; domain=www.php.net
Putting them side by side to make it easier to compare:
Set-Cookie: username=Rasmus; expires=Wed, 12-Dec-2001 21:58:55 GMT; path=/;
domain=www.php.net
Set-Cookie: username=Rasmus; expires=Wed, 12-Dec-01 21:58:55 GMT; path=/;
domain=www.php.net
R
Hi!
Last night I've found some interesting cookie behavior. I was testing some
script on my local server, so
I used short version of domain ( http://www ) to reach local webserver. My
script stopped working, so I started to investigate a little bit what's goin
on..
I've managed to get my script
Hi all,
I have a login script that works on one of my machines but not
another, and I've determined the problem has to do with setcookie().
One machine is using IE 5.50 and another is using 5.00, and I assume
therein lies the problem.
I've tried to plow through the dozens (hundreds?) of followup
Hi,
How to set a forever cookie into client machine. I use the following
syntax to set the cookie, but when I close the brower's window, then the
cookie is deleted when the browser closed.
setcookie("buyerid",$email,time()+360,"","$domain");
setcookie("buyeridpasswd",$passwd,time()+3
BTW here's my php.ini file. many thanks!
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 07, 2001 10:48 AM
Subject: [PHP] setcookie()
> Hi all,
>
> I have just migrated my scripts from redhat linux 6.2 and apache to win
AIL PROTECTED]'
Subject: [PHP] Setcookie
Is there any way to see whether or not the cookie setting has actually
worked without going to another page? I suspect there isn't but I'd like
confirmation ;)
Cheers
Max
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-
Header redirect isn't vaiable in this situation.
> --
> From: Jason Radley[SMTP:[EMAIL PROTECTED]]
> Sent: 31 August 2001 17:00
> To: Galvin, Max
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Setcookie
>
> $alertthem = &quo
On Wednesday, April 24, 2002, at 03:27 PM, Pusta wrote:
> When we are setting a cookie in a PHP page, that cookie cannot be
> accessed
> by any page in a different folder. When we move the pages into the same
> folder, the cookies worked fine. Can anyone shed some light on this??
Is the dif
ief Developer
www.PHPBeginner.com // where PHP Begins
> -Original Message-
> From: Erik Price [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 24, 2002 9:32 PM
> To: Pusta
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Setcookie problems...
>
>
> On Wednesday
The following code doesn't work properly on PHP 4.1:
Blah, blah";
setcookie("kuku", "abc");
setcookie("lala", "def");
setcookie("zuzu", "ghi");
?>
Because I wrote echo statement before setcookie. But it works on PHP
4.2. Is it due to "output_buffering=4096" directive in php.ini?
--
Best regard
List,
I'm trying to set a cookie like this:
http://".$_SERVER['SERVER_NAME'].$to."\n");
header("Set-Cookie: sid=$sid;\n\n");
exit();
}
}
function login() {
[... validation code here ...]
// set my cookie
setcookie("sid", $sid);
SetCookie() cannot know whether the client accepts the cookie or not. It
can only send it. You will need to check in a subsequent request if the
client decided to accept it or not.
-Rasmus
On Sat, 10 Nov 2001, Christian Dechery wrote:
> what does SetCookie() returns???
>
> I did a var_dump
When I use set cookie with an expire value it does not retain the value ?
setcookie ("TestCookie2", "test", $value,time()+3600);
I am using echo $TestCookie2; or
echo $HTTP_COOKIE_VARS["TestCookie2"];
in another page to view the value
Sean Weissensee
Ion Solutions
EMAIL PROTECTED]]
Sent: 19 June 2001 12:36
To: [EMAIL PROTECTED]
Subject: [PHP] SetCookie weirdness
Hi!
Last night I've found some interesting cookie behavior. I was testing
some script on my local server, so I used short version of domain (
http://www ) to reach local webserver. My script stopped w
them to be able to use the same cookies.
> -Original Message-
> From: Ray Hilton [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 20, 2001 3:26 AM
> To: 'Tomaz Kovacic'; [EMAIL PROTECTED]
> Subject: RE: [PHP] SetCookie weirdness
>
>
> This is actually a security
In my experience the understanding of SetCookie header differs form browser
to browser so much that it's horrible.
As far as I remember IE5.5 handled it correctly. IE5.0 didn't. Netscape I
think did (not completely sure).
In any case .. session-based cookies seem to work in all of them. just call
I won't quote, because this is not directly related to either mail.
I had a completely bizarre issue with MSIE not accepting cookies that
had highbit ascii values in them as their first character. Simply
fixed (in the end): add text to the front and strip it out in the
sitewide pre-execution scri
setcookie function, it's headers in general. Anyway, I assume you are having
the problem in 5.0 and 5.5 works OK.
-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 6:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] setcookie() woes
Hi all,
I have a login sc
utlive you, if that timestamp was really acceptable :)
> -Original Message-
> From: Mark Lo [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 02, 2001 12:33 PM
> To: php general
> Subject: [PHP] setcookie problem
>
>
> Hi,
>
>How to set a forever cookie into cli
On Monday 02 July 2001 21:32, scott [gts] wrote:
> probably becuase time() is seconds since 1970, and as
> far as i understand, once it gets over 999,999,999
> it will not work correctly becuase it will roll over
> (similar to the Y2k bug) and become 000,000,000
Typically the limit is 2^31 secon
OTECTED]]
Sent: Saturday, May 11, 2002 6:35 AM
To: [EMAIL PROTECTED]
Subject: [PHP] setcookie() in 4.2.0
The following code doesn't work properly on PHP 4.1:
Blah, blah";
setcookie("kuku", "abc");
setcookie("lala", "def");
setcookie("zuzu", "
David Busby wrote:
> List,
> I'm trying to set a cookie like this:
> function redirect() {
> if ($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_NAME']) {
> $to = func_get_arg(0);
> header("HTTP/1.1 301\n");
> header("Location:http://".$_SERVER['SERVER_NAME'].$to."\n");
I try to use this function to prevent that the same visitor vote for more than one
time in a hour but it don't work, the code is this:
if($vote!=1)
{
$time=time();
$time=$time + 36000;
setcookie("vote","1",$time);
}
If the visitor vote, the vote counts, than if he try to vote again the vote don'
Someone on this list mentioned, Internet Explorer does not accept cookie that
has timeout less than 7200 sec from current time. (PC's clock) How about try
longer timeout?
PS: Is this information is correct? Anyone? Correct me if it is wrong info.
--
Yasuo Ohgaki
""Sean Weissensee"" <[EMAIL PR
Hi list,
Regarding my last post about serialize, I've tried many things but couldn't
make it function.
I'm trying to store the data from a form in order to allow my user to stop
the process of filling the form and retrieve later what was inserted before.
Among many other thing I tried this litt
Read your data from $_COOKIE not $_COOKIES.
David Busby wrote:
> List,
> I'm trying to set a cookie like this:
> function redirect() {
> if ($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_NAME']) {
> $to = func_get_arg(0);
> header("HTTP/1.1 301\n");
> header("Location
you have to set to path and the domain name too...
setcookie('vote', '1', $time, '/', '.someite.com');
--
Chris Lee
Mediawaveonline.com
ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120
[EMAIL PROTECTED]
""Nuno Costa"" <[EMAIL PROTECTED]> wrote in message
000e01c09ff0$feee9570$1e01
On Thursday 28 March 2002 23:25, Rodrigo Peres wrote:
> Hi list,
>
> Regarding my last post about serialize, I've tried many things but couldn't
> make it function.
>
> I'm trying to store the data from a form in order to allow my user to stop
> the process of filling the form and retrieve later w
On Thu, 28 Mar 2002, Rodrigo Peres wrote:
> if(isset($submit)) {
> $x = addslashes($HTTP_POST_VARS);
> $y = serialize($x);
> setcookie("posted",$y)
> }
1) You probably should call serialize on the array to turn it into a
string before trying any string transformations like addslashes.
On Fri, 8 Dec 2000, Rustam Nabirov wrote:
> I'm using IE5.0 on Win98, it's as simple as it gets. But still I don't see
> any cookies saved. As far as I understand, on this platform cookies get
> saved in C:\WINDOWS\Cookies, and C:\WINDOWS\Temporary Internet Files has
> only shortcuts to those coo
Ive been playing with setcookie() and am stuck with trying to re-pull the
infomation I set, I use:
setcookie ("user_id", $userid, 1, "", "", 1);
to set the cookie and:
if(isset( $user_id )){
echo " cookie 'user_id': $user_id\n";
} else
echo" no cookie set ...\n";
}
to see if its there..
Just recently I've noticed an issue with setcookie. My scripts which normall
ran :
setcookie ("myCookie","Blah","time()+7201");
Are killing the cookie immediately after you close the browser window, or
access another https:// site. It appears as though the life of the cookie is
actually not bein
If you just echo $userid you will get the results.
do this
setcookie ("cookie_variable", "chocalate chip", 1, "", "", 1);
echo $cookie_variable
You can name the cookie_variable whatever you want and that will be referenced
as the variable to store "chocalate chip".
Now if you want to see the va
cheers Jack but Ive tried this and get the error msg:
Warning: Undefined variable: user_id in
C:/XITAMI/webpages/netrux/intothemain.php on line 14
so its not setting the varible by the looks of it any ideas? cheers
Jack Sasportas wrote in message
<[EMAIL PROTECTED]>...
>If you just echo $us
Hi Kris
Thats because you've wrapped the time() call and the addition inside a pair
of doublequotes.
Remove those and it'll work fine...
Regards
--
Shane
On Saturday 29 Dec 2001 6:35 pm, Kris Wilkinson wrote:
> Just recently I've noticed an issue with setcookie. My scripts which
> normall r
Oh yeah, about the lifetime of the cookie - with no valid expiry time it is
created as a session cookie - which is supposed to only live as long as the
browser does.
[opening a new independent browser window does not share the session, but
window.open() calls do, as do other 'browser created
On 29 December 2001 13:35, Kris Wilkinson spaketh unto ye recipient:
> setcookie ("myCookie","Blah","time()+7201");
For some reason, you must specify the domain, and make sure you use *exact*
formatting on the time, including the GMT suffix.
I gave up on setcookie and started using this:
$date
here is the example:
Feedback form
Feedback form
ENDH;
// End of page header
// Saving the page footer in the variable $tail.
$tail = <<
ENDT;
// End of page footer
// Set up variables that will be saved in the cookies
// Define unique cookie prefix
$ID = "My_ID";
// Co
53 matches
Mail list logo