title: Extending session object in express-session
body: <p>I know this is not an actual issue, but a help wanted.</p>
  <p>I'm struggling with typescript and express session and I have been playing around and trying to fiugure out this one for quite a bit.</p>
  <p>I'm trying to extend my session object, for that, I'm trying to do a merge of typings as per in the documentation:</p>
  <p>I have a <code>types/session.d.ts</code> with the following interface to be merged:</p>
  <pre><code>declare module 'express-session' {
    interface SessionData {
      userId: string;
    }
  }
  </code></pre>
  <p>But this is not working, as an example, in <code>other-folder/some.ts</code></p>
  <pre><code>req.session.userId = user.id;
  // Property 'userId' does not exist on type 'Session &amp; Partial&lt;SessionData&gt;'.
  </code></pre>
  <p>However, if I import <code>Session</code> from <code>express-session</code>, it does work:</p>
  <pre><code>import { Session } from 'express-session'
  
  declare module 'express-session' {
    interface SessionData {
      userId: string;
    }
  }
  </code></pre>
  <p>I'm not very proficient with TypeScript and I'm unsure about importing a module in a type defintion, event TypeScript complains about this (warning):</p>
  <p>'Session' is declared but its value is never read.</p>
  <p>I'm wondering, is this the right way of tackling the problem?</p>
  <p>What can I do different?</p>
  <p>Kind regards!</p>
  <p>PS: my tsconfig should be fine as I have available through my code other type definitions and they are working with no issues at all.</p>