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 session attributes are set when the response is prepared. When you get the session either with req.session('key') or req.getSession you get the session object back and modifying object properties on it will update the session in the response, e.g.
This will set the session.objProp.existingProp to "new value" in the response even if it was not before.
My suggestion to fix this is to have session.get return a deep copy of the value. You will have to explicitly session.set in order to update the value.
The text was updated successfully, but these errors were encountered:
Currently session attributes are set when the response is prepared. When you get the session either with
req.session('key')
orreq.getSession
you get the session object back and modifying object properties on it will update the session in the response, e.g.This will set the
session.objProp.existingProp
to"new value"
in the response even if it was not before.My suggestion to fix this is to have
session.get
return a deep copy of the value. You will have to explicitlysession.set
in order to update the value.The text was updated successfully, but these errors were encountered: