latheesan
01-04-2008, 02:07 AM
My problem is quite simple. I set a cookie, once a user logins here, like this :
/members/Login_Handler.php
<?php
// Login validated...
setcookie("ch_username", $user, time()+604800);
setcookie("ch_password", $pass, time()+604800);
?>
To test that the cookie is successfully set, i wrote a debug code like this:
/members/cookie_test.php
<?php print_r($_COOKIE); ?>
When i ran www.domain.com/members/cookie_test.php i saw the values i set at the login handler.
Now here's the problem :(
When i try to use the values from cookie in my www.domain.com/index.php (outside of the "memebrs" folder), i get nothing. I tried to do cookie test and it there is no cookie.
How can i fix this problem? I want the cookie i set made available to me anywhere on site (regardless of how deep the folder structure is).
/members/Login_Handler.php
<?php
// Login validated...
setcookie("ch_username", $user, time()+604800);
setcookie("ch_password", $pass, time()+604800);
?>
To test that the cookie is successfully set, i wrote a debug code like this:
/members/cookie_test.php
<?php print_r($_COOKIE); ?>
When i ran www.domain.com/members/cookie_test.php i saw the values i set at the login handler.
Now here's the problem :(
When i try to use the values from cookie in my www.domain.com/index.php (outside of the "memebrs" folder), i get nothing. I tried to do cookie test and it there is no cookie.
How can i fix this problem? I want the cookie i set made available to me anywhere on site (regardless of how deep the folder structure is).
