473,383 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

error with sessions and headers being sent, yet nothing but headers have been sent

I'm getting this error:

Warning: session_start(): Cannot send session cache limiter - headers
already sent in
/home/httpd/vhosts/publicdomainsoftware.org/httpdocs/pdsIncludes/McSessionInfo.php
on line 34

This is line 33 to line 36 of that class:
function startSession() {
session_start();
session_register();
}

Why would this generate an error?

Jul 17 '05 #1
3 1628
>I'm getting this error:

Warning: session_start(): Cannot send session cache limiter - headers
already sent in


Don't send ANYTHING before you call session_start().
No blank lines (these are very often difficult to notice).
No debug code.
No DOCTYPE.
No error or warning messages from functions that complain.
(like access to uninitialized variables).
No HTML.
Gordon L. Burditt
Jul 17 '05 #2
On 2 Jun 2005 13:01:15 -0700, lk******@geocities.com wrote:
I'm getting this error:

Warning: session_start(): Cannot send session cache limiter - headers
already sent in
/home/httpd/vhosts/publicdomainsoftware.org/httpdocs/pdsIncludes/McSessionInfo.php
on line 34

This is line 33 to line 36 of that class:

function startSession() {
session_start();
session_register();
}

Why would this generate an error?


What version of PHP are you on? Typically that error message also includes the
location that first produced the output, _as well as_ the line that failed
because headers have already been sent.

Don't know if the additional information is version specific...

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #3
put an ob_start() in the 1st line, this will prevent the sending of any
ouput

ob_end_clean() just above the session call will discard the buffer and
allow your session to start clean

for debugging you could use ob_get_clean(), returns the sent output as
a string to examine

micha

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bob | last post by:
Seem to have a problem ending a session. I get the following message. Warning: session_start(): Cannot send session cookie - headers already sent by (output started at...
5
by: Philip Ronan | last post by:
OK, here's my 2p worth: === Q. Why am I getting the error message 'Headers already sent'? A. PHP produces this error message when you try to set a header for a web page after you have already...
7
by: y_oda2002 | last post by:
I keep getting an error that says this Warning: session_start(): Cannot send session cache limiter - header already sent (output started at c:\program files\easyphp1-8\www\th...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
12
by: D. Shane Fowlkes | last post by:
This is a repost (pasted below). Since my original post, I've double checked the system clock and set all IIS Session Timeout values to 10 minutes. Still ...the problem occurs. I've also...
3
by: Tomasz Nowak | last post by:
Hello I have a problem with sessions - how to resolve this: "Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at...
4
by: XML newbie: Urgent pls help! | last post by:
I am using VB.Net. My program is to connect to a remote IPAddress. Once, it verifies the login information it should display the SessionID and enable some button . I appreciate your help and thanku...
5
by: Collector | last post by:
Hi guys, Is there any way how to delete a file after download headers have been sent? This code does not work for some reason. header('Content-type: application/xml');...
22
by: magic_hat60622 | last post by:
Hi all. I've got an app that dumps a user id into a session after successful login. the login page is http://www.mydomain.com/login.php. If the user visits pages on my site without the www (i.e.,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.