我是否可以在请求期间覆盖 NestJS SessionModule cookie 域?

Is it possible that I can override NestJS SessionModule cookie domain during request?

我有一个 NestJS,我将 SessionModule 用于用户 cookie,一切正常,但我需要为某些请求覆盖域名。不知道如何在 NestJS 中执行此操作,域的实际设置似乎在模块的 imports 数组中,没有空间可以注入 req: Request

@Module({
  imports: [
SessionModule.forRoot({
   session: {
     secret: 'someSecret',
      name: `ssid`,
      cookie: {
        maxAge: 1234125645654,
        domain: '' // I need to set this sometimes during some requests.
      },
   },
}),
  ],
export class AppModule implements NestModule, OnModuleInit { }

原来和req.session.cookie.domain = 'example.com'

一样简单