---
title: createCookie
---

# createCookie

<!--
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️ 

Thank you for helping improve our documentation!

This file is auto-generated from the JSDoc comments in the source
code, so please edit the JSDoc comments in the file below and this
file will be re-generated once those changes are merged.

https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/server-runtime/cookies.ts
-->

[MODES: framework, data]

## Summary

[Reference Documentation ↗](https://api.reactrouter.com/v8/functions/react-router.createCookie.html)

Creates a logical container for managing a browser cookie from the server.

## Params

### name

The name of the cookie.

### cookieOptions

Options for parsing and serializing the cookie.

## Returns

A [`Cookie`](https://api.reactrouter.com/v8/interfaces/react-router.Cookie.html) object for parsing and serializing the cookie.

