question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

index.js - line 342 - why is it calling the 'createSession()' function on store?

See original GitHub issue

I am implementing a custom session store (on Mongo), and I was getting an error about a createSession() function not being implemented. I further investigated and found out that this method was not implemented by the MemoryStore as well, but that it was implemented in the /session/store.js file.

Is that a mistake?

Why not just put req.session = new Session(req, sess); there instead? It makes much more sense…

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
dresendecommented, Feb 10, 2015

The documentation (Readme) does not explain correctly in my opinion. It should not say the store must extend from an EventEmitter but from the require("express-session").Store. This way you only need to implement the methods as described in the docs (get, set and destroy). Otherwise createSession is needed (which means you need to create resetMaxAge, touch, save, … on req.session).

2reactions
caubcommented, Nov 14, 2017

But store#createSession is not listed in Readme, it’s rather store#set that plays this role https://github.com/expressjs/session#storesetsid-session-callback

edit: it’s supposed to set session in req object

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript calling functions in another file - Stack Overflow
I have a JavaScript Code A running in node.js continously without restarting. As it runs, it creates its own data and stores it...
Read more >
Index - API Manual
# Page Tags and summary 8 AnalyserNode.getByteFrequencyData() A Uint8Array . 9 AnalyserNode.getByteTimeDomainData() A Uint8Array . 10 AnalyserNode.getFloatFrequencyData() A Float32Array .
Read more >
Reference Guide - IBM
1.1 Reference Guide. Contains detailed information about the individual components of IBM Tivoli Directory Integrator. 7.1.1: Connectors, Function Components, ...
Read more >
Diff - 51fb98171a..c1ab029096 - chromium/src - Git at Google
-bool VolumeSupportsADS(const FilePath& path); - -// Returns true if the ZoneIdentifier is correctly set to "Internet" (3). -// Note that this function must...
Read more >
Oracle to Aurora PostgreSQL Migration Playbook - Awsstatic
Support for AWS Secrets Manager integration You can store the database ... Unlike Oracle triggers, PostgreSQL triggers must call a function and do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found