Skip to main content

All Questions

Tagged with
0 votes
0 answers
20 views

using cookies from next/headers marks all pages as dynamic

When I am using cookies from "next/headers" it marks all pages as dynamic, this is not what I want my structure is like this in layout.tsx I have a child server component in which I want to ...
spyrox's user avatar
  • 120
0 votes
0 answers
17 views

Retrieving cookie in service (API functions) folder in NextJS 14

I am using NextJS I have been struggled with this problem for quite some time. Essentially, I want to sepearte logic and UI in my project. I want to only paste in the necessary parameters (e.g. ...
Huy Nguyen Quang's user avatar
0 votes
0 answers
47 views

Unable to get Cookie in nextjs that is set by laravel api in my browser?

I have a Next.js application where I am trying to set up Axios to include the CSRF token automatically in all non-GET requests. I have written the following code to retrieve the XSRF-TOKEN from ...
Kamran Ali's user avatar
0 votes
1 answer
52 views

How do I read Next.js cookie from form action in middleware

I'm currently implementing basic JWT authentication within Next 14 and is currently working on protected routes. This is the login logic in /login/action.ts import { cookies } from "next/headers&...
ChuChuwi's user avatar
  • 940
0 votes
0 answers
72 views

Next.js Middleware Cookie Deletion and Redirect Not Working Together

I'm working with Next.js 14 and facing an issue in my middleware where I need to delete a cookie based on the user's authentication status and then redirect the user to a specific URL. However, I'm ...
Opeyemi Odedeyi's user avatar
0 votes
0 answers
47 views

Cannot set nextjs 14 cookies in route handlers fetch call

In my program that written with nextjs 14, which I wrote with a route handler, a request is sent to the api and when the api response is executed successfully, a cookie is set, but this cookie is only ...
Arman Bagheri's user avatar
0 votes
0 answers
29 views

How to send cookie to next js middleware(static page)?

I have a static authorization page. After successful authorization I update the cookie and redirect to /profile. const handleConfirmSuccess = (data: string) => { AuthService.otp({ ...
Артур Нахатакян's user avatar
-1 votes
1 answer
82 views

how do i send httponly cookie with fetch request in nextjs

I've completed a guide and now aim to retrieve user details using a server component. However, despite the cookie being present in the browser, it doesn't seem to appear in the request. I customized ...
Harry's user avatar
  • 11
0 votes
1 answer
139 views

In NextJS 14, Changed Cookie State Not Sent to Server Upon router.refresh()

Summary Cookie data is used in a server component to modify a fetch call. Cooke state is modified in a client component (using js-cookie). router.refresh() is called in the client component after the ...
Gabriel Richards's user avatar
1 vote
0 answers
859 views

How to do page refresh with token management with middleware in NextJS?

I'm using Nextjs 14. I have successfully implemented logic for handling both refresh and access tokens in my application. This was achieved through the use of middleware for setting cookies, and I'm ...
Noussa's user avatar
  • 540
0 votes
0 answers
167 views

Error accessing cookies at middleware.ts (Next.js 13)

I'm having trouble accessing the cookies at the middleware.ts of my next.js app. I don't know why it fails if I have another next.js app with the same structure and it works, I suppose that becase the ...
Juancho Plass Cedillo's user avatar
1 vote
1 answer
2k views

Trouble with Server Actions in Next.js v14 - Cookies Modification Error

I'm working with Next.js v14 and encountering an issue with Server Actions, specifically when trying to modify cookies. Despite following the documentation and ensuring that my functions are Server ...
Léo Lhuile's user avatar
2 votes
2 answers
2k views

Cookies Not Being Set in Production in Next.js App

I'm working on a Next.js application where I'm setting a cookie after a successful login. The cookie is supposed to store an authentication token. This works as expected in my local development ...
Opeyemi Odedeyi's user avatar
0 votes
0 answers
11 views

Sso with nextjs

I want make a Single Sign On, where when I access my dashboard.sunize.com.br if there isn't a access_token, I will be redirected to sso.sunize.com.br and I will be authenticated and save my access and ...
perfluka's user avatar
0 votes
1 answer
741 views

How to Validate User Session with Cookies in Next.js on Page Reload using the App router

I'm working on a Next.js application where I need to validate the user's session by checking a cookie against my API whenever the user reloads the website or navigates to it. I'm trying to implement ...
Opeyemi Odedeyi's user avatar

15 30 50 per page