p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: Chapter 13 P.475 auth_user.php HELP W/ session_start();


Message #1 by "Vick Ahuja" <indian_jedi@h...> on Wed, 4 Jul 2001 08:16:35
I'm having a problem with the auth_user.php file in chap. 13.  

Particularly the session_start(); function and keep getting the following 

errors:



Warning: Cannot send session cookie - headers already sent by (output 

started at c:\program files\apache 

group\apache\htdocs\sql\common_db.inc:87) in c:\program files\apache 

group\apache\htdocs\sql\auth_user.php on line 63



Warning: Cannot send session cache limiter - headers already sent (output 

started at c:\program files\apache 

group\apache\htdocs\sql\common_db.inc:87) in c:\program files\apache 

group\apache\htdocs\sql\auth_user.php on line 63



Any help would be appreciated,

Vick

Message #2 by "Lawrence" <lawrence@k...> on Wed, 4 Jul 2001 12:11:38 -0700
This is a common problem. It results from the session_start() function not

being at the top of the page. Make sure you put this function at the very

top. There cannot be any white space, no open lines, between the top of the

page and this function. If there is whitespace then Apache will send the

headers, and once they are sent you can not set a session, since the

sessions rely mostly on cookies, which must be sent with the headers.







> I'm having a problem with the auth_user.php file in chap. 13.

> Particularly the session_start(); function and keep getting the following

> errors:

>

> Warning: Cannot send session cookie - headers already sent by (output

> started at c:\program files\apache

> group\apache\htdocs\sql\common_db.inc:87) in c:\program files\apache

> group\apache\htdocs\sql\auth_user.php on line 63

>

> Warning: Cannot send session cache limiter - headers already sent (output

> started at c:\program files\apache

> group\apache\htdocs\sql\common_db.inc:87) in c:\program files\apache

> group\apache\htdocs\sql\auth_user.php on line 63

>

> Any help would be appreciated,

> Vick

>






  Return to Index