Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-backend
Model
Config
SessionLifetime
BackendModel.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Backend\Model\Config\SessionLifetime
;
8
9
use
Magento\Framework\App\Config\Value
;
10
use
Magento\Framework\Exception\LocalizedException
;
11
17
class
BackendModel
extends
Value
18
{
20
const
MAX_LIFETIME
= 31536000;
21
23
const
MIN_LIFETIME
= 60;
24
28
public
function
beforeSave
()
29
{
30
$value
= (int)$this->getValue();
31
if
(
$value
> self::MAX_LIFETIME) {
32
throw
new
LocalizedException
(
33
__
(
34
'The Admin session lifetime is invalid. '
35
.
'Set the lifetime to 31536000 seconds (one year) or shorter and try again.'
36
)
37
);
38
}
elseif
(
$value
< self::MIN_LIFETIME) {
39
throw
new
LocalizedException
(
40
__
(
'The Admin session lifetime is invalid. Set the lifetime to 60 seconds or longer and try again.'
)
41
);
42
}
43
return
parent::beforeSave();
44
}
45
}
Magento\Framework\App\Config\Value
Definition:
Value.php:28
Magento\Framework\Exception\LocalizedException
Definition:
LocalizedException.php:17
elseif
elseif(isset( $params[ 'redirect_parent']))
Definition:
iframe.phtml:17
Magento\Backend\Model\Config\SessionLifetime\BackendModel
Definition:
BackendModel.php:17
__
__()
Definition:
__.php:13
Magento\Backend\Model\Config\SessionLifetime
Definition:
BackendModel.php:7
Magento\Backend\Model\Config\SessionLifetime\BackendModel\MAX_LIFETIME
const MAX_LIFETIME
Definition:
BackendModel.php:20
$value
$value
Definition:
gender.phtml:16
Magento\Backend\Model\Config\SessionLifetime\BackendModel\beforeSave
beforeSave()
Definition:
BackendModel.php:28
Magento\Backend\Model\Config\SessionLifetime\BackendModel\MIN_LIFETIME
const MIN_LIFETIME
Definition:
BackendModel.php:23