Jump to content

Cookie Problems


PC Nerd

Recommended Posts

Cookies can be picky especially on certain servers. If you are working on Localhost you have to set the cookie up differently. For localhost see this article:

http://www.aeonity.com/frost/php-setcookie-localhost-apache

 

//bool setcookie ( string $name [, string $value [, int $expire [, string $path [, string $domain [, bool $secure [, bool $httponly]]]]]] )

 

Using that this is the proper way to setup a cookie.

 

<?php
  setcookie($name, $value, strtotime('+ 30 minutes'), '/', 'www.yourdomain.com');
?>

 

Now a tone here is the destroying of a cookie is done the same way except with minus minutes. Cookies set on yourdomain.com will only work on yourdomain.com they will not work on www.yourdomain.com, at least on my server. So I setup an .htaccess to rewrite any request to yourdomain.com to goto www.yourdomain.com so I do not get any inconsistencies.

ok, this person posted in the other thread :

 

HaLo2FrEeEk :

 

"Did you try clearing your cache of all cookies, making sure all of them are gone, then running the script again?  Maybe it is picking up residual cookie...crumbs (lol, pun)"

 

thats why i asked about the locations of the cookies, becauase i couldnt find any where all the other cookies are kept.... !

 

um, ill check that cookie syntax now

 

 

thankx for all your help!  ;D

 

 

 

 

u,, where you set the domain and locatio stuff, is there a global variable or value stating where this script ifs running from?

 

 

and i dont think that the cookie setting is the problem, becauase it was working until i added the database login ID value.....

 

 

any more suggestions?

 

thankx

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.