In my installation of the Magento 2.2. I have a strange misbehavior related to sessions. Specifically: I can't get any data from session after the browser page has been refreshed.
As result I have an "empty" session for admin customer and I can't authorize to magento admin panel(redirect loop).
The files of the session are created(I can see them). I have been trying to use different windows server(open server) and vagrant(Homestead) and it's always the same.
The Redis has the same issue: Magento doesn't return value from the session storage.
Always prints "SET". $value
is NULL:
/** @var \Magento\Catalog\Model\Session $session */
$session = $this->_objectManager->get('\Magento\Catalog\Model\Session');
$value = $session->getMyValue();
if (is_null($value)) {
echo 'SET';
$session->setMyValue('test');
} else {
echo $session->getMyValue();
}