You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the session middleware is designed to inject a mutable session container into the ServerRequestInterface attributes.
While this approach is highly usable, it doesn't really compose well with functional approaches, and it breaks the ServerRequestInterface immutability by design (this choice is conscious).
Just a suggestion, but I don't want folks to think "OH EM GEE, THAT LIBRARY BREAKS IMMUTABILITY!"
The mutable approach was consciously picked due to ease of use, but the functional approach is still viable and may be implemented if there is some interest or some strong use-case for it.
The text was updated successfully, but these errors were encountered:
Seriously, that really breaks message immutability, but while that approach brings some mutability drawbacks, it's not a PSR-7 violation at all, since PSR-7 allows mutable attributes. So I still prefer the "convenient" way in this case.
Currently, the session middleware is designed to inject a mutable session container into the
ServerRequestInterface
attributes.While this approach is highly usable, it doesn't really compose well with functional approaches, and it breaks the
ServerRequestInterface
immutability by design (this choice is conscious).Here's what the current approach looks like:
In a functional/immutable world, this would become:
Just a suggestion, but I don't want folks to think "OH EM GEE, THAT LIBRARY BREAKS IMMUTABILITY!"
The mutable approach was consciously picked due to ease of use, but the functional approach is still viable and may be implemented if there is some interest or some strong use-case for it.
The text was updated successfully, but these errors were encountered: