Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Area Sessions: Magento 2 Should not Allow "area-less" Sessions During an Area Aware Request #526

Closed
astorm opened this issue Mar 8, 2014 · 3 comments
Labels
improvement Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: needs update

Comments

@astorm
Copy link

astorm commented Mar 8, 2014

Magento 2, like Magento 1, currently uses the PHP session_name function to set a session name of frontend or adminhtml. This separates area sessions and is a good thing.

However, if a Magento module developer observes an event that fires prior to an area existing, and in that observer instantiates a session — Magento's session code will not have an area name to use for the session name. Instead, PHP will use the default session name.

This MUST NOT happen. This creates a situation where the system seems to behave normally, but is saving session information to the wrong area. If the module developer's code path is called for every request, it means session area data is not longer split between the frontend and backend. If the module developer's code path is called conditionally, it means session data is being saved/read from both the area session store and the default PHP session store intermittently. This creates seemingly random system behavior.

Both these situation create potential instability in the system, and have led to a number of confusing and intermittent bugs over the years with Magento 1.

The simplest solution would be a fatal exception

#File: lib/Magento/Session/SessionManager.php
if (!empty($sessionName)) {
    $this->setName($sessionName);
}
else
{
    throw new Exception('Arealess session not allowed');    
}

However, any solution will have implications for existing system code across the board. Therefore, a decision on the right solution is in the responsibility of the system system owner (eBay), and not the the external community.

@verklov verklov self-assigned this Apr 1, 2014
@verklov
Copy link
Contributor

verklov commented Apr 1, 2014

@astorm, thank you for reporting this! The issue is in the product backlog. We will notify you once the team finishes the analysis.

@vpelipenko
Copy link
Contributor

Internal ticket: MAGETWO-23159

@vpelipenko vpelipenko added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development PS and removed PROD labels Feb 23, 2015
magento-team pushed a commit that referenced this issue May 8, 2015
…ea-less" Sessions During an Area Aware Request #526
@vpelipenko
Copy link
Contributor

This issues was fixed and available from 0.74.0-beta8. Could you it on this version?

magento-team pushed a commit that referenced this issue Aug 14, 2015
magento-team pushed a commit that referenced this issue Apr 8, 2016
magento-engcom-team added a commit that referenced this issue Apr 29, 2019
…ingMethod.method_code when no shipping methods are available #526

 - Merge Pull Request magento/graphql-ce#526 from XxXgeoXxX/graphql-ce:2.3-develop#524
 - Merged commits:
   1. b78aa2a
   2. 3b48e1d
   3. cf46fef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: needs update
Projects
None yet
Development

No branches or pull requests

4 participants