I have to read session variable into bootstrap.php
file and have to assign this to a variable. When I am accessing session variable I am getting error:
Error: Call to a member function session() on null.
Below is my code.
$year=$this->request->session()->read('Auth.User.year');
Configure::write('Theme', [
'logo' => [
'large' => "<b>FlexiComs</b>$year"
],
]);