hapijs / yar

A hapi session manager
Other
133 stars 59 forks source link

Password rotation #163

Open simoncarbajal opened 2 years ago

simoncarbajal commented 2 years ago

Support plan

Context

How can we help?

In the documentation you write: "Consider rotating your cookie session password on a regular basis" but you fail to explain how to do this. Is straightforward if we restart the server every time we want to rotate the session password:

import yar from '@hapi/yar'
const server = new hapi.Server({ port })
const yarPlugin = {
    plugin: yar,
    options: {
      name: 'yarCookie',
      cookieOptions: {
        password: randomPassword(),
      }
    }
  }
await server.register(yarPlugin)

How can we do this without restarting the server?