Difference between revisions of "PhpBB4/Session Component"
From phpBB Development Wiki
|Line 6:||Line 6:|
Revision as of 01:24, 23 November 2009
Access to session information should be provided through an interface to be defined here.
Session information needs to be accessible by session id but it should also be available for displaying information such as a "who is online" list.
public function createSession($session_id);
public function getSession($session_id);
public function getSessionList();
These are implementations that should come with a default installation. Of course it should be easy to add and select alternative implementations.
This mechanism is used in phpBB3.
Allows for better performance since the database session storage requires a database write on nearly every request. Also useful if you want to run phpBB on multiple servers. The servers can share a memcached instance containing the sessions so that the server can be selected with round robin.
PHP uses the filesystem for its session management by default. Whether implementing this makes sense given that we have a database driven storage is questionnable.