Open
Description
Describe the change
I don't mean that it accepts a name
, but rather that the implementation is built in such a way to support multiple sessions at the same time
const session = await useSession(event, { name: 'foo', ..})
const session2 = await useSession(event, { name: 'bar, ..})
session.id !== session2
This is very useful for holding different references for different things without bloating the very very restrictive space a cookie can hold.
Most commonly, this can be used for flashing data. Something I had to enhance my unstorage driver layers can be done for free. It's a shame really..
Is there a reason for that? If so, is there a reason why it is a map at all?
URLs
https://h3.unjs.io/examples/handle-session
https://h3.unjs.io/utils/advanced#session-utils
Additional information
- Would you be willing to help?
Activity