You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// $sesionBag would need to be an inline call I guess$sessionBag = \System::getContainer()->get('request_stack')->getSession()->getBag(
\Contao\System::getContainer()->get('contao.routing.scope_matcher')->isBackendRequest(
\Contao\System::getContainer()->get('request_stack')->getCurrentRequest() ?? \Symfony\Component\HttpFoundation\Request::create('')
) ? 'contao_backend' : (
\Contao\System::getContainer()->get('contao.routing.scope_matcher')->isFrontendRequest(
\Contao\System::getContainer()->get('request_stack')->getCurrentRequest() ?? \Symfony\Component\HttpFoundation\Request::create('')
) ? 'contao_frontend' : 'attributes'
)
);
$sessionBag->get('foo');
$sessionBag->set('foo', 'bar');
$sessionBag->remove('foo');
$sessionBag->all();
$sessionBag->replace($foo);
Additional information:
If $key if referer, popupReferer or CURRENT_ID, the access should be to $session->get(...) instead of the session bag. Not sure if that's really worth it though.
The text was updated successfully, but these errors were encountered:
Deprecated since Contao: 4.0
Before:
After:
Additional information:
If
$key
ifreferer
,popupReferer
orCURRENT_ID
, the access should be to$session->get(...)
instead of the session bag. Not sure if that's really worth it though.The text was updated successfully, but these errors were encountered: