Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-02-2006, 09:51 PM   PM User | #1
manicman
New Coder

 
Join Date: Aug 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
manicman is an unknown quantity at this point
Cannot send session cookie, cannot send session cahce limiter

I am trying to create a user system for my website, when I log in I get these errors:
Code:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at c:\documents and settings\administrator\desktop\intranet\development\final\admin\main.php:9) in c:\documents and settings\administrator\desktop\intranet\development\final\admin\main.php on line 10

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\documents and settings\administrator\desktop\intranet\development\final\admin\main.php:9) in c:\documents and settings\administrator\desktop\intranet\development\final\admin\main.php on line 10
Can anyone tell me how to get around this? I have tried removing all the 'white space'.
manicman is offline   Reply With Quote
Old 09-02-2006, 10:40 PM   PM User | #2
googleit
Regular Coder

 
googleit's Avatar
 
Join Date: Jul 2006
Location: birmingham, uk
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
googleit is an unknown quantity at this point
have you put
PHP Code:
session_start() 
on line 1?
googleit is offline   Reply With Quote
Old 09-02-2006, 11:45 PM   PM User | #3
Lee Stevens
Regular Coder

 
Join Date: Aug 2006
Location: UK, London, Dartford
Posts: 221
Thanks: 3
Thanked 14 Times in 14 Posts
Lee Stevens is an unknown quantity at this point
Yeah that should be your first line in your script and make sure its not included anywere else in the script!
Lee Stevens is offline   Reply With Quote
Old 09-03-2006, 08:44 AM   PM User | #4
manicman
New Coder

 
Join Date: Aug 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
manicman is an unknown quantity at this point
It is on the first line of the php code but before that I have all the HTML DOCTYPE etc. I take it I should put session_start() on the very first line before the HTML stuff?

Thanks.
manicman is offline   Reply With Quote
Old 09-03-2006, 09:01 AM   PM User | #5
Lee Stevens
Regular Coder

 
Join Date: Aug 2006
Location: UK, London, Dartford
Posts: 221
Thanks: 3
Thanked 14 Times in 14 Posts
Lee Stevens is an unknown quantity at this point
Should be the first line wraped in <?php and ?>
Lee Stevens is offline   Reply With Quote
Old 09-03-2006, 07:35 PM   PM User | #6
manicman
New Coder

 
Join Date: Aug 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
manicman is an unknown quantity at this point
Yep, it is the first line wrapped in the first set of PHP tags on the page.
manicman is offline   Reply With Quote
Old 09-03-2006, 08:18 PM   PM User | #7
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
Quote:
Originally Posted by manicman
I take it I should put session_start() on the very first line before the HTML stuff?
Correct.
Fumigator is offline   Reply With Quote
Old 09-04-2006, 03:16 PM   PM User | #8
manicman
New Coder

 
Join Date: Aug 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
manicman is an unknown quantity at this point
Thanks, I have got it working now.
manicman is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:30 PM.


Advertisement
Log in to turn off these ads.