phpBB

Development Wiki

PhpBB4/Session Component

From phpBB Development Wiki

SessionStorageInterface

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.

interface SessionStorageInterface
// incomplete !!
    
public function createSession($session_id);
    public function 
getSession($session_id);

    public function 
getSessionList();
}

SessionStorage Implementations

These are implementations that should come with a default installation. Of course it should be easy to add and select alternative implementations.

Database

This mechanism is used in phpBB3.

memcached

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.

Filesystem

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.

Account

Combines a SessionStorage implementation with a user model instance to provide access to the user who initiated the current request. The user model will potentially be accessed through a user interface within this component to keep it seperate from the actual model. Alternatively this service could be moved elsewhere.

interface AccountInterface
{
}