nextjs - ✅(Solved) Fix Docs: Write cookies from Server Functions [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#86781Fetched 2026-04-08 02:09:17
View on GitHub
Comments
2
Participants
3
Timeline
10
Reactions
0
Assignees
Timeline (top)
commented ×2referenced ×2assigned ×1closed ×1

Fix Action

Fixed

PR fix notes

PR #86827: docs: Server functions rename

Description (problem / solution / changelog)

Closes: https://github.com/vercel/next.js/issues/86781

Changed files

  • docs/01-app/01-getting-started/08-updating-data.mdx (modified, +4/-2)
  • docs/01-app/02-guides/redirecting.mdx (modified, +9/-9)
  • docs/01-app/03-api-reference/04-functions/after.mdx (modified, +2/-2)
  • docs/01-app/03-api-reference/04-functions/cookies.mdx (modified, +9/-9)
  • docs/01-app/03-api-reference/04-functions/forbidden.mdx (modified, +1/-1)
  • docs/01-app/03-api-reference/04-functions/permanentRedirect.mdx (modified, +1/-1)
  • docs/01-app/03-api-reference/04-functions/redirect.mdx (modified, +1/-1)
  • docs/01-app/03-api-reference/04-functions/unauthorized.mdx (modified, +1/-1)
RAW_BUFFERClick to expand / collapse

What is the documentation issue?

Not sure if i'm wrong or this is a small detail.

Docs for cookies mention many times that cookies can only be mutated by Server Actions or Route Handlers. https://nextjs.org/docs/app/api-reference/functions/cookies

But we can also do this (.set(), .delete()) from Server Functions in general, right?

I think i'm doing it in my app without problems.

Again maybe a detail but having the word "Action" there so many times threw me off, and i can't think of a way where i architect this flow to use a form action (and corresponding server action) instead of a simple server function (accessed as a normal function from a RSC and as an endpoint from the client).

And maybe there was already an issue about this but i missed it.

Is there any context that might help us understand?

More so, the "Server Actions" links in the cookies docs page all link to a more general page about "Updating data" which talks about Server Functions.

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/app/api-reference/functions/cookies#setting-a-cookie

extent analysis

TL;DR

The documentation for cookies in Next.js should be updated to reflect that cookies can be mutated by Server Functions, not just Server Actions or Route Handlers.

Guidance

  • Review the documentation for cookies in Next.js to ensure it accurately reflects the capabilities of Server Functions.
  • Verify that the current implementation of cookie mutation in Server Functions is working as expected in the application.
  • Consider submitting a pull request or issue to update the documentation to include Server Functions as a means of mutating cookies.
  • Check the links in the cookies documentation to ensure they point to the correct pages, such as the page on Server Functions.

Example

No code snippet is provided as it is not necessary to illustrate the issue.

Notes

The issue seems to be a documentation inconsistency rather than a functional bug. The user has already successfully implemented cookie mutation in Server Functions, but the documentation does not reflect this capability.

Recommendation

Apply workaround: Update the documentation to reflect the correct information, as the current documentation may cause confusion for other developers.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING