Description
Description (*)
The session gets loaded/started in the controller but it might not ever need to be started. A lot of routes, like the category controller, don't have any need for the session. We can't be sure that they won't though, so we can't just use the FLAG_NO_START_SESSION
flag to disable them on certain routes.
The block of code found in the following link is what needs to be placed elsewhere. Then, when the singleton is created, it can load that.
Expected behavior (*)
Sessions don't start/load until something tries to read a value from them or write to them.
Benefits
Potentially less session starting because we don't need to open sessions on all pages. This means less locking. Meaning potentially less waterfall issues in loading and thus faster pages.
Potentially less RAM used in the cache. This is especially prevalent for bots that don't go to pages that don't use the session.