Closed
Description
(context: question by @harlan-zw in nuxt discord regarding reliablilty of sessions and weather he should use storage to keep private session data)
H3 sessions are encrypted and only readable by server-side. This can guarantee two things:
- Only server can mutate session so it's data is reliable
- Only server can read/decrypt session so it's data is private
Auth-utils, exposes an edpoint (session.get
) that server-side decrypts the session for user. It takes away the second benefit of session encoding which can guarantee data remains secret and private.
While there must be good benefits of this, it is something IMO insecure to do by default and developers might wrongly put sensitive data based on encryption guarantee that will be exposed again.
I would highly recommend (as a breaking change) to only expose data.public
part of the session.