Closed marr closed 1 year ago
The session is not defined within server-plugins: A session is always connected to an incoming request of a user. Inside a server plugin we do not have that request, so we do not have a session (:
You can basically use the session everywhere where you have access to an event: H3Event
🎊 This is the case in endpoints and in server-middleware.
Hope that helps - let me know if there's anything else (:
You can basically use the session everywhere where you have access to an
event: H3Event
🎊 This is the case in endpoints and in server-middleware.
@BracketJohn I am trying to access the event.context.session
from my server-middleare but it comes empty.
Am I missing anything?
Look at this example:
This is a simple server/middleware
followed by a server/api
.
Ask your question
I am trying to use the session module inside a server plugin. I thought accessing the
ssrContext.event.session
might work, but it appears not to. Is something like this possible?Additional information
The docs say:
Does that mean I can't write to the session inside nuxt middleware?