Extending session object with util functions (e.g. accessors) #1067
Unanswered
jamil-naja-acn
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The data I am storing requires some safeguarding and additional pre-processing before the API handler kicks in.
This could be done by extending the session object with such functions that API handlers could use (instead of accessing the session data directly)
Whats the best way to do this without risking the additional function interfering with the serialisation of the session?
I can see defineMethod here: https://github.com/expressjs/session/blob/master/session/session.js#L136
If I follow the same approach; would it be safe not to interfere with the core framework / serialisation?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions