|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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... |
|
#2
|
|||
|
|||
|
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...) |
|
#3
|
|||
|
|||
|
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. |
![]() |
| Viewing: Codewalkers Forums > General > General Chat > Have a Cookie Problem - Heres a Hint! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|