samsonasik / SanSessionToolbar

:zap: Session Toolbar that can be applied into Zend/Laminas DeveloperTools
MIT License
38 stars 11 forks source link

Session is being started if not started already #51

Closed boesing closed 8 years ago

boesing commented 8 years ago

Hi,

I am actually testing around with zf2 session handling, e.g. and came to the point, where I created a lazy session manager since I dont want to start session stuff for any page if its not loaded.

I realized that SanSessionToolbar always creates a new Container instance (which triggers session start, e.g.) to fetch session data. This is kind of annoying since the session is probably not started since its not necessary at this moment. Therefore sansessiontoolbar should display some kind of "session not started, no data available" or something like that instead of starting the whole session read/write stack e.g.

There are PHP functions to check if session is started, maybe you create a check in SanSession SessionManager like

 if (session_status() !== PHP_SESSION_ACTIVE) { return; } 

Until then, I have to disable this module for the moment. Probably I create a PR if I have some more time.

samsonasik commented 8 years ago

PR is welcome, please provide tests as well in the PR to avoid regression, Thanks.

samsonasik commented 8 years ago

@boesing I've created PR https://github.com/samsonasik/SanSessionToolbar/pull/52 for it, please tests with composer require san/san-session-toolbar:dev-hotfix/51 . If that worked for you, I can create new release for it.