iamolegga / nestjs-cookie-session

Idiomatic Cookie Session Module for NestJS. Built on top of `cookie-session` 😻

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Destroying session

colthreepv opened this issue · comments

It does not seem possible with this library, how to achieve it?

Hello, I know how to RTFM, the point was not to read the mainstream documentation when using this library.

For anyone interested, this is a simple copy-pasta to achieve it:

@Controller()
export class ViewController {
  // .... other methods
  @Get('logout')
  @Render('logout')
  logoutGet (@Req() req: Request) {
    req.session = null
  }
}

Hi, feel free to open PR for adding this to documentation 👍