Session Does not work
Customer and Default Session (I'have not test the other types) doen not work. Also the php variable $_SESSION contains bad values. This issue is reproducible in magento 2.1.0-rc1, 2.0.7, 2.0.6, and lower versions. You can reproduce the bug in the following way:
-
Install a magento 2.1.0-rc1 or a lower version
-
Change deploy mode to developer:
php bin/magento deploy:mode:set developer -
Download and install this module: Test.zip
-
Make sure all cache types are enabled
-
Go to home page, under the LUMA logo you can see "Session status: " The ReadSession.php Block will execute the following code:
$session=$this->_session; $session->start(); return $session->getMessage();The template read-session.phtml will execute: `Session status:
@carmelomtb, looking at your description it would appear that your home page is cached under full page cache on the first call, prior to the session message being set. After setting the session message and returning to the home page you are receiving the cached version of the home page, which did not cache the session message.
You should take care in including session specific content in the rendered page, as you could inadvertently display customer data to other users. You may want to look at delivering customer specific data via ajax and using knockout.js to display the necessary data. This will allow you to continue to utilize the full page cache.
Hi @carmelomtb , GitHub issue tracker is intended for technical issues only, not questions and technical assistance. Please refer to the Community Forums or Magento Stack Exchange site for technical questions. In your case, the programming questions forum is likely the most appropriate. https://community.magento.com/t5/Programming-Questions/bd-p/programming-magento-2