Current location: Hot Scripts Forums » Programming Languages » PHP » Cookie Problem


Cookie Problem

Reply
  #1 (permalink)  
Old 12-14-06, 10:29 AM
tommyc325's Avatar
tommyc325 tommyc325 is offline
Wannabe Coder
 
Join Date: Sep 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Cookie Problem

hey im having a cookie problem.

below im setting my cookie.
PHP Code:

setcookie("shirepoll1""voted"time()+15768000);

//echo $_COOKIE["shire_poll1"];
echo "<META HTTP-EQUIV='Refresh'CONTENT='0; URL=../shire.php'>"
and here im trying to echo it on a diffrent page.

PHP Code:

echo $_COOKIE["shirepoll1"]; 

nothings showing up --- but if i look in firefox pref. and look at my cookies its set with the right value and everything.

whats wrong here?
Reply With Quote
  #2 (permalink)  
Old 12-14-06, 12:01 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
Is this other page at the same path as the page that sets the cookie?

Without a 4th "path" parameter in the setcookie(...) function call, the cookie will only be available to scripts in the same path that it was set in.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #3 (permalink)  
Old 12-14-06, 12:31 PM
tommyc325's Avatar
tommyc325 tommyc325 is offline
Wannabe Coder
 
Join Date: Sep 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
yea its in a different path
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cookie problem, not being set. stormshadow PHP 5 12-10-06 03:55 PM
Cookie problem Tempestshade PHP 5 06-14-05 05:37 AM
Setting a cooke (time it expires) mcrob PHP 4 04-27-05 12:13 PM
Passing info between pages w/ URL HairySpider JavaScript 6 01-09-05 08:47 AM
cookie problem darkcarnival PHP 11 12-27-03 06:17 PM


All times are GMT -5. The time now is 05:50 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.