Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

using fSession methods in templates.

posted by patrick m. 8 years ago

When I call things like fAuthorization::checkAuthLevel('admin') in templates (the footer, for example) I frequently get the following error:

"session_start(): Cannot send session cache limiter - headers already sent (output started at {doc_root}/index.php:33)"

Turning on template buffering fixes this issue, or alternately I can call fSession::open() in init.php, but this seems odd. Am I implementing this incorrectly?

No, not really. PHP's session handler requires the use of cookies, but it needs to be turned on before output is sent to the user. Calling fSession::open() is probably your best bet.

posted by wbond 8 years ago