COOKIE problems
| From: | Navid Y. | Date: | Wed, 16 Apr 2003 17:28:52 +0000 |
| Subject: | COOKIE problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144132@lists.php.net to get a copy of this message | ||
Hello Everyone,
I have set my session.save_path to C:/PHP/tmp_sessions, from the default.
Does this change also affect the way I use cookies?
The problem I'm having with cookies is that I set a cookie and I confirm to
see if it exists by running a print_r($_COOKIE). Ok, so the cookie I set
exists. Now I test it in an if() statement like so:
index.php
------------------------------
if (isset($_COOKIE['var'])) {
[Do This]
} else {
[Do That]
}
When I do this it shows that the index.php page doesn't even exist. But when
I say:
index.php
------------------------------
if (!isset($_COOKIE['var'])) {
[Do This]
} else {
[Do That]
}
The index.php page loads just fine. So how can it not exist in an if()
statement after I've already tested its existance and confirmed that it
does, in fact, exist? Actually, what confuses me is why the index.php page
doesn't even load at all while checking the cookie's existance in the if()
statement. This is all really frustrating to me. I would really appreciate
your help, guys.
Note: The cookie I set doesn't expire for a long while. I set the cookie on
a separate page than the index.php page, then used the header()'s redirect
function to redirect to the index.php page. Also sessions work fine using
the current session.save_path setting. The cookies get set and are saved in
that directory that I asked it to save it to.
-----Original Message-----
From: Ilja Polivanovas [mailto:ilja.polivanovas@assis.lt]
Sent: Tuesday, April 15, 2003 11:29 PM
To: php-general@lists.php.net
Subject: [PHP] Re: PHP as daemon process
> >
> > Hallo all
>
> Hallo.
>
> > Does anybody know how to run PHP script via PHP-CLI as daemon process
in
> > Linux or FreeBSD?
>
> Well, which? Are you running it from a CLI, or as a daemon? Or are you
> talking about launching the daemon from a CLI?
i'm talking about PHP script which runs as daemon (may not be CLI).
>
> Making a PHP script act as a daemon is pretty straightforward. Since
> the script can pass data through stdio, you can run a daemon that gets
> launched from inetd (or equivalent). If you want the script to accept
> TCP socket connections, a close read of
> http://www.php.net/sockets
> should help to dispel the fog. The page even includes a pair of client
> and server script examples.
>
No problem with soceket client-server, was talking about detaching from
shell.
php -q script.php & is killed after closing shell. That is the
problem.
> In other words, RTFM.
>
Reading about PCNTL now :/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php