Re: [PHP] Cookie Expire Problem

2001-04-08 Thread Christian Reiniger

On Sunday 08 April 2001 06:15, you wrote:

> Your cookie is set to expire in the year 2280. You think that's a
> little overkill?
>
>
> And it runs into the UNIX-style Y2K problem which is...um...13 years
> from now? Well anyway...

2038 with a 32bit processor

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

void sleep(){for(long int sheep=0;!asleep();sheep++);}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Cookie Expire Problem

2001-04-07 Thread Jeffrey Paul


actually, the offending line is:

$cookie_expire = "$time*3";

it may be set too high if you triple it, but i think what might be 
happening is that it's setting $cookie_expire to '986703865*3' which would 
be invalid.

if this is the case (i dont think you can multiply inside of quotes), then 
this is caused by bad programming style.  Better is to only quote when 
dealing with strings... if you know it's math, then leave the quotes at home.

solution:

$cookie_expire = time() + 86000*365*10;

(86000 = number of seconds in the day, times 365 days, times 10 
years).  Order of operations will multiply before adding. bada-bing, bada-boom.

-j


PS: hi everyone out there in php land, i'm new on the list, but you might 
know me from eyearcee.


At 12:15 AM 4/8/2001, Plutarck wrote:
>The problem is that it is too far in the future.
>
>Your cookie is set to expire in the year 2280. You think that's a little
>overkill?
>
>
>And it runs into the UNIX-style Y2K problem which is...um...13 years from
>now? Well anyway...
>
>Make your cookie's expire time a little more reasonable. Like 5 years from
>now, which is this many seconds:
>15768
>
>So set it to time()+15768
>
>If someone has your cookie on their machine in the year 2280 and gets pissed
>that their login failed when it shouldn't of, don't worry about it. You'll
>be dead, too feeble to care, or a god for creating an application that still
>works after 270 years ;P
>
>
>--
>Plutarck
>Should be working on something...
>...but forgot what it was.
>
>
>""Jeff Oien"" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > This code won't set a cookie. I took the time part from a past
> > post to set the time for wy ahead. I must be doing it wrong
> > though:
> >
> > $time = time();
> > $cookie_name = "auth";
> > $cookie_value = "ok";
> > $cookie_expire = "$time*3";
> > $cookie_domain = "";
> > setcookie($cookie_name, $cookie_value, $cookie_expire, "/" ,
>$cookie_domain, 0);
> >
> > Thanks.
> > Jeff Oien
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
[EMAIL PROTECTED]  -   0x514DB5CB
he who lives these words shall not taste death
becoming nothing yeah yeah
forever liquid cool


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Cookie Expire Problem

2001-04-07 Thread Plutarck

The problem is that it is too far in the future.

Your cookie is set to expire in the year 2280. You think that's a little
overkill?


And it runs into the UNIX-style Y2K problem which is...um...13 years from
now? Well anyway...

Make your cookie's expire time a little more reasonable. Like 5 years from
now, which is this many seconds:
15768

So set it to time()+15768

If someone has your cookie on their machine in the year 2280 and gets pissed
that their login failed when it shouldn't of, don't worry about it. You'll
be dead, too feeble to care, or a god for creating an application that still
works after 270 years ;P


--
Plutarck
Should be working on something...
...but forgot what it was.


""Jeff Oien"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This code won't set a cookie. I took the time part from a past
> post to set the time for wy ahead. I must be doing it wrong
> though:
>
> $time = time();
> $cookie_name = "auth";
> $cookie_value = "ok";
> $cookie_expire = "$time*3";
> $cookie_domain = "";
> setcookie($cookie_name, $cookie_value, $cookie_expire, "/" ,
$cookie_domain, 0);
>
> Thanks.
> Jeff Oien
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Cookie Expire Problem

2001-04-07 Thread Jeff Oien

This code won't set a cookie. I took the time part from a past
post to set the time for wy ahead. I must be doing it wrong
though:

$time = time();
$cookie_name = "auth";
$cookie_value = "ok";
$cookie_expire = "$time*3";
$cookie_domain = "";
setcookie($cookie_name, $cookie_value, $cookie_expire, "/" , $cookie_domain, 0);

Thanks.
Jeff Oien

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]