code: function getSession (ctx) {
      let signedCookie = ctx.cookies.get(sessionKey, {signed: cookie.signed}) || ''
      signedCookie = signedCookie.split('.')
  
      return ctx.thunk()(function () {
        if (!storeAvailable) throw new Error('session store is not available')
        if (signedCookie[0]) return store.get(signedCookie[0])
      })(function (err, session) {
        if (err) throw err
        let sessionId
        let originalHash
  
        if (session) {
          sessionId = signedCookie[0]
          originalHash = signedCookie[1]
          if (hashSession(session, sessionId) !== originalHash) session = null
        }
  
        if (!session) {
          session = genSession()
          sessionId = genSid(sidSize)
          originalHash = hashSession(session, sessionId)
        }
  
        return {
          session: session,
          sessionId: sessionId,
          originalHash: originalHash,
          isNew: originalHash !== signedCookie[1]
        }
      })
    }
docs: get session from store
  get sessionId from cookie
  save sessionId into context
  get session from store