#medusa session

9 messages · Page 1 of 1 (latest)

indigo gale
#

I'm having alot of trouble configuring session options with medusa. They don't seem to have any effect. The req.session.id property is different for every request, even when a user has logged in. I've tried configuring the session options in medusa.config to use "connect.sid". Here's what my options look like:
const projectConfig = { ... session_options: { secret: process.env.COOKIE_SECRET, name: "connect.sid", resave: false, rolling: false, saveUninitialized: false, ttl: 365 * 24 * 60 * 60 * 1000 } };
Nothing that I set here seems to have any effect at all. And connect.sid is not even being written.
Definitely something I am not seeing here (Medusa 1.20)

indigo gale
#

What started this was:

#
  • user A logs in to the server
#
  • medusa nextjs-starter's getCustomer (medusaClient.customers.retrieve) returns user A
#
  • user B on another machine gets onto the site
#
  • in the backend, user A's session is somehow cached in memory. user B is recognized (in the backend session) as customer A
#

(without logging in)

#

has anyone seen such behavior? I thought that the session must be misconfigured, but no changes to the session_options seem to have any effect at all (on anything)

#

I hope I've explained it clearly