General Chat
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsGeneralGeneral Chat

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old June 12th, 2003, 09:47 AM
Marius2000 Marius2000 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Adelaide, Australia
Posts: 3 Marius2000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Have a Cookie Problem - Heres a Hint!

OK heres a lesson that I've learn't
(I searched many forums for help and found nothing so Im sharing what I learn't)
I've researched this out and tested it - here are my results that may help someone in the future.

I couldn't get cookies to work for the life of me (even with ltw_calendar) so I asked my host if they supported them - standard reply was "YES you have buggy code".

Here is what I learned
Cookies will not work if this command is turned off in the php.ini file "output_buffering = " by default this has a value of 4096.
You might ask how I found this, I had a hunch my host hadn't fully tested the cookies (especially on php) so I started to do more research. I found a command called ini_get(""), so I made a script that retrieved all my hosts ini settings, then did that on my test server and compared them, the setting above was different, after testing I found that if this is left blank cookies will not work, neither will other headers.
So a big lesson I have learn't is make sure your testing environment will be the same as that as your host - check their settings if something works at home but not on the hosts site. If you want a copy of the simple script let me know.

All the best
This a great site...

Reply With Quote
  #2  
Old June 14th, 2003, 03:30 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Have a Cookie Problem - Heres a Hint!

first thing, you are wrong.


second, you could find all that much faster, just by using phpinfo() function.


and last, you could find out all that much better, just by reading the f* manual...

http://php.net/setcookie
http://php.net/header
...


(it is stated very clear that you have to use cookies and headers before you output anything to the browser...)

Reply With Quote
  #3  
Old June 14th, 2003, 05:25 AM
Marius2000 Marius2000 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Adelaide, Australia
Posts: 3 Marius2000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Have a Cookie Problem - Heres a Hint!

mmmm Thanks for your so kind reply...

the phpinfo() function would have helped lots but I guess there are so many functions that knowing all of them for a newbie is hard.. (thats for the hint! - makes checking those server settings much easier)

And I am not wrong - When output buffering is disabled cookies do not work.

"You can do this by calling ob_start() and ob_end_flush() in your script, or setting the output_buffering configuration directive on in your php.ini or server configuration files. "

For a newbie who downloads any script and finds out that cookies aren't working, to work out how to use the ob_start() and ob_end_flush() commands when all the searches for cookies return "just do a setcookie()" is very difficult, especially when all you are trying to do is understand why the darn cookies aren't working on some servers.

You are such a nice administrator I think I won't post here any more especially when you treat newbies with such callace. You wonder why newbies are warey about posting when administrators (who obviously know everything) reply to their posts in such a way.


Reply With Quote
Reply

Viewing: Codewalkers ForumsGeneralGeneral Chat > Have a Cookie Problem - Heres a Hint!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT