# Session

Instead of managing the $_SESSION variable directly, you can use the Wolff Session class.

All the session methods work with the time expressed in minutes (unless it’s specified here).

General methods

Just remember to use Core\Session.

Start session

Start the session:

Session::start();

Count session variables

Count the session variables:

Session::count();

Set session time

Set the session global time:

Session::setTime(10);

Get starting time

Get the session time (in seconds):

Session::getStartTime();

Get session time with format (Hours, minutes and seconds):

Session::getStartTime(true);

Get remaining time

Get session remaining time (in seconds):

Session::getRemainingTime();

Get session remaining time with format (Hours, minutes and seconds):

Session::getRemainingTime(true);

Unset

Unset session:

Session::empty();

Destroy

Destroy session:

Session::kill();

Variable methods

Set

Declare a session variable:

Session::set('name', $value);

Get

Getting a session variable:

Session::get('name');

Has

Check if a session variable exists:

Session::has('name');

Unset

Unset a session variable:

Session::unset('name');

Get variable time

Getting variable time (in seconds):

Session::getVarTime('name');

Getting variable time with format (Hours, minutes and seconds):

Session::getVarTime('name', true);

Set variable time

Set the variable live time:

Session::setVarTime('name', 10);

Add time to variable

Adding time to a variable:

Session::addVarTime('name', 10);