code: function refreshSession (ctx, session, originalHash, isNew) {
      return ctx.thunk()(function () {
        if (!session && isNew) return
        let newCookie = extend({}, cookie)
        // delete session
        if (!session || !(session.ttl > 0)) {
          this.cookies.set(sessionKey, null, newCookie)
          return store.destroy(this.sessionId)
        }
  
        let newHash = hashSession(session, this.sessionId)
        // rolling session will always reset cookie and session
        if (!options.rolling && newHash === originalHash) return
  
        newCookie.maxAge = session.ttl
        this.cookies.set(sessionKey, this.sessionId + '.' + newHash, newCookie)
        return store.set(this.sessionId, session)
      })
    }
docs: after everything done, refresh the session
  if session === null; delete it from store
  if session is modified, update cookie and store