MV framework logo
  • Admin Panel
  • Architecture
  • Support
  • Feedback
Download .zip ver. 3.4.2 from 04.03.2026
Dark mode
Download .zip ver. 3.4.2 from 04.03.2026
  • Admin Panel
  • Architecture
  • Support
  • Feedback
Documentation:
Getting started
  • Installation and launch
  • Folder structure
  • Launching a simple website
  • Pre-installed models
  • SQLite getting started
  • System settings
  • Migrations
  • Debugging
Models
  • General principles of models
  • Data types
  • Model setup
  • Simple models
  • Foreign keys
  • Trees
  • Many to many
  • Group
  • Records management
  • Managing simple models
  • Additional features
Templates and routing
  • General principles of templates
  • Router object
  • MV object
  • Create a new template
  • Output of data in template
  • Record object
  • Files and images
  • Date and time
  • Redirects and http
  • Sending email
  • Special methods
Forms
  • Creating forms
  • Setting up form fields
  • Validating form fields
  • Form security
  • Working with form data
  • Using data from models
  • Form methods
SQL queries
  • Query builder
  • Direct queries
  • Pagination
  • Sorting
  • Filtration
Additional
  • AJAX
  • Sessions
  • Authorization
  • Plugins
  • Caching
  • Security
  • Admin panel add-ons
MV tracker
Dark mode
Documentation:
Getting started
  • Installation and launch
  • Folder structure
  • Launching a simple website
  • Pre-installed models
  • SQLite getting started
  • System settings
  • Migrations
  • Debugging
Models
  • General principles of models
  • Data types
  • Model setup
  • Simple models
  • Foreign keys
  • Trees
  • Many to many
  • Group
  • Records management
  • Managing simple models
  • Additional features
Templates and routing
  • General principles of templates
  • Router object
  • MV object
  • Create a new template
  • Output of data in template
  • Record object
  • Files and images
  • Date and time
  • Redirects and http
  • Sending email
  • Special methods
Forms
  • Creating forms
  • Setting up form fields
  • Validating form fields
  • Form security
  • Working with form data
  • Using data from models
  • Form methods
SQL queries
  • Query builder
  • Direct queries
  • Pagination
  • Sorting
  • Filtration
Additional
  • AJAX
  • Sessions
  • Authorization
  • Plugins
  • Caching
  • Security
  • Admin panel add-ons
MV tracker
Home Additional Sessions

Sessions

Session support is implemented via the standard PHP session using the Session class, which stores the user's session data in a separate container. The session starts automatically upon the creation of the MV object.

To activate the session, you need to set the configuration in the config/setup.php file.

'SessionSupport' => true

The main methods for working with session data are listed below. They are all static and can be called from anywhere in the application.

Основные методы для работы с данными сессии перечислены ниже. Все они являются статическими и могут быть вызваны из любого места приложения.

//Set a value
Session::set('key_name', 'value');

//Get a value, the second argument is an optional default value
//if the 'key_name' key is missing
$value = Session::get('key_name');
$value = Session::get('key_name', '');

//Check for the existence of all listed keys in the session
if(Session::has('key_1', 'key_2', 'key_3'))
{
   ...
}

//Get all keys and values from the session as an array
$data = Session::all();

//Remove a key and its value from the session
Session::remove('key_name');

//Delete all session data
Session::clear();

//Get the session parameters set when it was started
$value = Session::getParameter('ip_hash');
$value = Session::getParameter('browser_hash');
$value = Session::getParameter('start_time');

Previous section

AJAX

Next section

Authorization
MV workshop banner
MV tracker

© 2014-2026, MV framework team

MV tracker project Github