cookies-next
cookies-next copied to clipboard
Getting, setting and removing cookies on both client and server with next.js
Hi, I am facing problem to set and get cookies across the subdomains. let me explain my scenario. so we have a domain and two subomain like `localhost.com:3000` & `admin.localhost:3000`,...
If I create a new (`fetch` API) `Request` in a Next.js [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), e.g. ```typescript export async function GET(req: Request) { const myResponse = new Response('Hello, World', { status: 200,...
I make my custom functions to handle cookies, they extra logic, and for server components lib require options, so pls make OptionsType exported. Thx. @andreizanik ```javascript // pls make OptionsType...
updated the dependencies and made next peer dependency https://github.com/andreizanik/cookies-next/issues/74 solved this issue added deleteAllCookies function
here's my setCookie, that happens after authorization completed: ` .addCase(authUser.fulfilled, (state, action) => { state.userAccessToken = action.payload.access_token; setCookie("m_token", action.payload.refresh_token, { httpOnly: true, secure: true, sameSite: "none", }); state.authStatus = RequestStatus.FULFILLED;...
What could be better is to have a server action or a router handler that update the cookie, and then revalidate all data with `revalidatePath('/', 'layout').`, then in the layout,...