Skip to content

expires cant set? #8

@Jan-T-Berg

Description

@Jan-T-Berg
export const session = nextAppSession<MySessionData>({
  // Options
  name: 'SID',
  secret: process.env.JWT_SECRET,
  cookie: {
    httpOnly: process.env.NODE_ENV == 'production',
    secure: process.env.NODE_ENV == 'production',
    sameSite: 'strict',
    expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 7), // 1 week
  },
});

I would like to set the session manually. Unfortunately, this does not work.

export type CookieOptions = {
    httpOnly: boolean;
    path: string;
    domain?: string | undefined;
    secure: boolean;
    sameSite?: boolean | 'lax' | 'strict' | 'none';
    maxAge?: number;
    expires?: Date | null;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions