Skip to content

[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory #106

@visuallization

Description

@visuallization

Hey there,

I get the above mentioned error, everytime I call:

req.session.regenerate(async () => {
  // update session
  
  return res.redirect(req.path);
});

This is my session:

app.use(session({
  store: new FileStorage({
    path: sessionDir,
  }),
  secret: "some secret",
  saveUninitialized: true,
  resave: true,
}));

The thing is, that it looks like it tries to access the new file before it was created, because the missing file is always created shortly after the warning. Is this a race condition? What would be the best way to handle this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions