I have a server action that destroys the session:
./src/app/actions/killSession.ts
'use server'
import {cookies} from 'next/headers'import {getIronSession} from 'iron-session'import {SessionSchema} from '@schemas/session'import {ironSessionProps} from '@server/ironSessionProps'
export const killSession = async () => { const session = await getIronSession<SessionSchema>( await cookies(), ironSessionProps, ) session.destroy() console.log('session destroyed')}which I am trying to execute from the template of my logged out page layout
./src/app/(logout-pathways)/layout.tsx
'use server'
import React from 'react'import {killSession} from '@actions/killSession'
export default async function PageLayout({ children,}: Readonly<{ children: React.ReactNode}>) { await killSession()
return {children}}But I get the following error:
