Sessions?
-
Hello,
I was wondering how does WordPress deal with sessions? I want to have a plugin that will allow my viewers to register and log in to view certain content and I have been testing some functionality and it seems to work fine, but I am not sure if there isn’t anything “bad” going underneath.
If I create a session in the header of my theme (via a plugin hook) I get no errors and all my session variables seem to be accessible fine. If I try to start a session in a footer, I get the following error:
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\wordpress\wp-includes\l10n.php:36) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\wordpress\wp-content\themes\test\index.php on line 28
On the other hand, if I don’t start a session myself, whatever session vars I set are unset by the next page load.
Hence I am confused about how WordPress deals with sessions and since they are a fundamental part of my sytem (that I simply cannot risk having any voulnerabilities) I would appreciate some guidance on this topic.
Cheers!
- The topic ‘Sessions?’ is closed to new replies.