Skip to content

used cookies().get('SID'). cookies() should be awaited before using its value. #19

@subanath

Description

@subanath

used cookies().get('SID'). cookies() should be awaited before using its value.

session.ts
import nextAppSession from 'next-app-session';

// Your session data type
type MySessionData = {
access_token?: string;
counter?: number;

}

// Setup the config for your session and cookie
export const session = nextAppSession({
// Options
name: 'SID',
secret: 'secret goes here'
});

header component
import LoginRegister from './headercomponents/LoginRegister';
import { session } from "@/lib/session";
import LogoutButton from "./headercomponents/LogoutButton";

export default async function Header() {
const loggedInUserSession = await session().get('loggedInUserSession');
const loggedUser = await loggedInUserSession?.Name || '';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions