Login   Register  
PHP Classes
elePHPant
Icontem

Not Working

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      PHP MySQL Authentication Class  >  All threads  >  Not Working  >  (Un) Subscribe thread alerts  
Subject:Not Working
Summary:headers warnings causing session to fail
Messages:1
Author:john m howitt
Date:2013-07-05 08:26:46
 

  1. Not Working   Reply   Report abuse  
Picture of john m howitt
john m howitt
2013-07-05 08:26:46
I used the code for a small project and while it seemed fine i could not get it to authenticate.
Switched errors on and realised that the headers had already been sent and this was causing the code to fail.

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /Applications/MAMP/htdocs/auth/index.php:3) in /Applications/MAMP/htdocs/auth/xclass.php on line 18

added ob_start();

and

ob_end_flush();
in the appropriate place and now works fine.