Closed kynx closed 4 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.
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?
Thanks, @kynx — merged, and released with 1.3.0.
This PR adds two interfaces:
InitializeSessionIdInterface
adds aninitialiseId()
method to sessions. This returns the session ID, creating a new ID if not present or regenerating an existing oneInitializePersistenceIdInterface
adds aninitialiseId()
method to persistence. This returns a newSession
with the ID generated / regenerated if required.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.