Help with setcookie()
Posted on
16th Feb 2014 07:03 pm by
admin
Merry Xmas to those on this foruum
Older guy here with some experience but not allot so please be gentle.
I am having problems with setting cookies on my web site. At one time they worked and for the life of me I cannot find the problem... 3 days now ... no joy.
To make it as simple as I can, I wrote a very simple program that should demonstrate the problem... I am not that good on server settings, but i have a hunch it is on the server. My program (testcookie.php) has phpinfo() combined with the small program that demonstrates so you can see the exact problem.
Did you know?Explore Trending and Topic pages for more stories like this.
Can anyone see what I am doing wrong?
BTW, I have no .htaccess file.
You can see the problem here .. almcom<dot>net/testcookie.php
Here is the same code you will see on the above location.
Code: <?php
setcookie("IM_A_COOKIE", "IM_COOKIE_CONTENT", time() + 3600, "/"); //cookie expires in 60min
echo "<br />Running testcookie.php ------- SEE BELOW phpinfo() -------";
echo "<br />-----------------------------------begin display of testcookie.php code------------------<br />";
highlight_file("testcookie.php");
echo "<br />----------------------------------------end of testcookie.php code------------------------<br /><br />";
if (isset($_COOKIE["IM_A_COOKIE"]))
echo "It was set... " . $_COOKIE["IM_A_COOKIE"] . "!<br />";
else
echo "<h4>Cookie was <font color=red>NOT</font> set</h4>";
echo "-----------------------------------------------------------------------------------";
echo "<br />Here is the phpinfo():...";
phpinfo();
?>
<HTML>
<HEAD><TITLE><br /><br />Cookie Tester</TITLE></HEAD>
<BODY>END of testing with testcookie.php</BODY>
</HTML>
No comments posted yet
Your Answer:
Login to answer
79
25
Other forums
how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are tw
TimeZoneOffset
Hello,
Please i need your help. I have a system that users can use to punch in and out. This
Sufficient protection from bad input?
I am writing a simple script to let people upload 'pages' of their own content, be it simply a few b
user administration
Dear @all,
what I have to do to set the user defaults for new users. At the moment I woul
what business processes?
Hi,
A general question. What business processes (like OTC - Order to Cach, P2P, R2R etc)
Passing vars to the DB
I have 3 small testing tables:
ID TYPE
1 pepperoni
2 C. bacon
3 taco
ID TY
PayPal Redirect Issue
When I have my paypal button set so that is redirects to http://empiremarketing.ca/order.php,it work
Creating Images from images in PHP
Okay well I am trying to make a 'dynamic' calender image with PHP.
I have images like this:
Why do I get this error
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/a5488351/public_html/b
natcasesort works on one server but not on another
Hi
I have a problem that I was hoping that someone can help me with.
I'm trying to use