Jump to content

Cookie Problems


PC Nerd

Recommended Posts

um, i cant seem to find the cookie even after i know its created and after i can see its ( still timestamp )output

 

can i find exactly where the cookie is, through php, becauase i dont think that its being saved in the same place?

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

 

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.