Proble with cookies.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alehawk
Forum Newbie
Posts: 1
Joined: Tue Nov 02, 2010 7:38 am

Proble with cookies.

Post by alehawk »

Hi!
I got problems managin cookies.
I got 2 php pages.

page 1

Code: Select all

$expire=time()+60*60*24*30;
echo setcookie("PSA_AC", "2", $expire);
When you click on a link it will go to a refresh

Code: Select all

<meta http-equiv="refresh" content="0;url=http://psadip/home/page2.php">
And the landign page, page 3

Code: Select all

<?php
print_r($_COOKIE);
echo $localremoto;
exit();
My problem is that I loose the cookie :S
If i print_r($_COOKIE) the only thing I get is the PHPSESSID but not my cookie.
If before redirecting, in the same HTML I print_r($_COOKIE); exit(); the cookie will be retrieved.
Any Ideas?
Tnx!
Post Reply