LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-10-2005, 11:17 PM   #1
caged
Member
 
Registered: Jan 2004
Location: new zealand
Distribution: Mandrake,Slackware
Posts: 165

Rep: Reputation: 30
Slack 10.1 setting up php with cookies


Hi.

I have setup a slackware computer as a webserver to do my php development work on before putting the site on the proper-and-paid-for webspace. So i want to setup apache and php to work in the same way as the webspace.

All is going well but I'v hit a problem using cookies.
The following code is a little test...
Code:
<?PHP
{
  setcookie('test_cookie','some testing data',time()+(60*60));
  print("<html>
  <head><title>testing</title></head>
  <body>
  ");
  echo "hello the cookie sez: ".$_COOKIE['test_cookie']." ::";
  

  print("
  </body>
  </html>");
  


}
?>
it works fine on the webspace but on my local slack machine the $_COOKIE varible doesnt return anything.

Do I need to turn cookies on in php.ini or in the httpd.conf file?

Thanks Heaps,
Ben.
 
Old 10-10-2005, 11:29 PM   #2
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
It works fine on my default apache config, I just needed to reload the page because the cookie doesn't exists at the moment the cookies are read from my machine.
 
Old 10-11-2005, 12:27 AM   #3
caged
Member
 
Registered: Jan 2004
Location: new zealand
Distribution: Mandrake,Slackware
Posts: 165

Original Poster
Rep: Reputation: 30
Hi.

cheers for your interest.

I also need to refresh the page when viewing it from the server space but refreshing has no effect on my local slack server. It still prints nothing.

I have also added a...
Code:
if(isset($_COOKIE['test_cookie']))echo "cookie is set";
...line to my test file. again this only announced that the cookie was set when run on the server space and not my slack machine.

cheers,
Ben.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
cookies in php RazorKnight Programming 1 10-08-2004 04:31 AM
PHP - Cookies, unserialize() dhbiker Programming 1 07-28-2004 02:18 PM
PHP HELP: values are deleted from cookies in Mozilla xbaez Programming 0 07-13-2004 11:14 PM
PHP and cookies. jacksmash Programming 13 04-02-2004 09:01 AM
enable back fortune cookies in slack 9.1 little_ball Slackware 2 04-02-2004 04:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration