1. Computing

Discuss in my forum

Always send your cookies to a browser before the code

By , About.com Guide

Storing a user's information in a cookie can be really useful, but it can also be incredibly frustrating if it's not working! One of the most common mistakes made with cookies is sending them after some code has already been sent.

The code doesn't have to be substantial, a simple <html> at the top of your document before the cookies will mess things up! You should always include your cookies BEFORE any code is sent to the browser.

So remember this if you are having trouble with cookies working on your website: Cookies Before Code!

  1. About.com
  2. Computing
  3. PHP / MySQL
  4. Troubleshooting
  5. Cookies Before Code

©2013 About.com. All rights reserved.