Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 25th, 2006, 05:53 AM
Authorized User
 
Join Date: Jan 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot send session cookie - header !!!!!"

Hi,
I am working on the myorder.php...........
   I am handling the sessions for this , i have developed a separete that has the session information, this file contains
<?php
ob_start();
session_start();
$sid=session_id();
?>
when i call this file on the add-to-order.php and also writing these lines on the top of the page as(myorder.php)
<?
ob_start();
require("Connections/Session.php");
....
....
...
....
header(Location: myorder.php);
exit(1);
?>
Then i face 3 types of errors.
1- session_start(): Cannot send session cookie - headers already sent
2- session_start(): Cannot send session cache limiter - headers already sent
3- Cannot modify header information - headers already sent by (output...


If anyone would help, i am very thankful to him for this.
Thanks.:)
 
Old January 25th, 2006, 10:49 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Cookies are sent as HTTP headers, HTTP headers must be sent before output from the document begins.

Check the beginning of your script, make sure there is no white space or new lines before the opening <?php delimiter.

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design





Similar Threads
Thread Thread Starter Forum Replies Last Post
Encrypting session cookie krisXp Classic ASP Databases 1 November 9th, 2006 10:21 AM
Cookie and Session rinventive PHP How-To 0 December 6th, 2005 07:09 PM
session and cookie problem (empty session file) msincan BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 February 27th, 2005 05:31 PM
Session and Cookie authentification dsunmedia PHP How-To 2 August 30th, 2004 06:52 PM
Session cookie problem rogierio Classic ASP Professional 0 October 15th, 2003 09:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.