next-app-session
next-app-session copied to clipboard
A Next.js App router secure server-side session library
When calling session().destroy() it trigger on store.set
I want to do some protected route, but middlware in App Route seems cannot get the session on server. `export default async function middleware(req: NextRequest) { //always shows {} const...
Hi, unfortunately I am failing to get next-app-session running in Next.js edge middleware:  The issue seems to be coming from `cookie-signature`, which uses the crypto module. In my code,...
``` */ export const session = nextAppSession({ // 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...
Errors in middleware , while calling function from lib/session Error list: 1) (middleware)/./node_modules/redis-errors/index.js 2) TypeError: Cannot read properties of undefined (reading 'charCodeAt') Full code : import { NextResponse } from...
code @majidkuhail : export async function destroySession() { await session().destroy(); }