"Martin Johansson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi!
Cookies makes me go AHHHHGHH!!
Please help me with this:

I am setting a cookie like this in my loginscript:

setcookie("devProcCookie", "cookie value"."|".time(), 31536000);     // Set
cookie
header("Location: inside.php");
exit;

So far it works!
But when I go to the inside.php page that looks like this:

$cookie_life = 30;
// The cookie lives for 1 hour
$tok = explode("|", $HTTP_COOKIE_VARS["devProcCookie"]);
$cookie_value = $tok[0];
$creation_time = $tok[1];
if((time()-$creation_time) > $cookie_life)
// If time expires go to cookie_expired.php
{
// cookie has expired so delete it.
setcookie("devProcCookie", "");
header ("Location: cookie_expired.php");
exit;
}
setcookie("devProcCookie", "cookie value"."|".time(), 31536000);     // If
time hasnt expired update the cookie time


Something happens in netscape. Everything works fine in IExplorer.
Netscape says:

Notice: Undefined index: devProcCookie in
c:\inetpub\wwwroot\devproc\beta\inside.php on line 2
Notice: Undefined offset: 1 in c:\inetpub\wwwroot\devproc\beta\inside.php on
line 4
Warning: Cannot add header information - headers already sent by (output
started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in
c:\inetpub\wwwroot\devproc\beta\inside.php on line 9
Warning: Cannot add header information - headers already sent by (output
started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in
c:\inetpub\wwwroot\devproc\beta\inside.php on line 10

What is wrong!!!!!!!!!
Please help me someone!!!
/Martin



---
Ditt utgående mail är virusfritt.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.371 / Virus Database: 206 - Release Date: 2002-06-13




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to