Fork me on GitHub

OOPS: Object Oriented Php Sessions

Documentation

Constructor

void Oops::__construct ( void )

Session Control

void Oops::start ( void )

Calling the start method of an Oops instance is the OOPS equivilent of the built-in session_start() function. If a session already exists, it is reused, otherwise, a new session is created. This must be called before any other session control methods can be used.

void Oops::regenerate ( void )

This method regenerates the session ID of the currently open session. This is done for extra security. By default, this method is called automatically everytime the session is started. To disable this functionality, change the "session_regeneration" value in the config file to false.

void Oops::destroy ( void )

Destroys the session and all data related to it.

Data Storage

void Oops::set_value ( string $name, mixed $value )

Stores $value under the name $name in the session for later use.

void Oops::get_value ( string $name )

Retrieves the value associated with $name.

void Oops::unset_value ( string $name )

Removes the value associated with $name.

Read-only Properties

string Oops::session_id

The current session ID.