zendframework / zend-expressive-session

Session middleware for PSR-7 applications
BSD 3-Clause "New" or "Revised" License
27 stars 11 forks source link

Add interfaces to initialise session ID #38

Closed kynx closed 4 years ago

kynx commented 5 years ago

This PR adds two interfaces:

LazySession can now initialise the ID if the persistence supports it.

I outlined a couple of use cases on the forum. Though when I wrote that I was thinking the session would also needed to be started. I've since realised that isn't required.

boesing commented 5 years ago

Wondering if @Ocramius https://github.com/psr7-sessions/storageless would be better for problems like yours.

Maybe you have a look on that project and re-think if you still need these changes in here.

kynx commented 5 years ago

Yeah, aware of that. Doesn’t really fit for the current project.

Curious though, given that you can getId() on an existing session, what’s the reason not to get the id of a new / regenerated one?

weierophinney commented 4 years ago

Thanks, @kynx — merged, and released with 1.3.0.