Skip to content

Commit ed77157

Browse files
update session documentation links (#13448)
1 parent 4281172 commit ed77157

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

.changeset/plenty-hounds-heal.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
update session documentation links

contributors.yml

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
- infoxicator
140140
- IsaiStormBlesed
141141
- Isammoc
142+
- iskanderbroere
142143
- istarkov
143144
- ivanjeremic
144145
- ivanjonas

docs/api/utils/isSession.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ title: isSession
1010

1111
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.isSession.html)
1212

13-
Returns true if an object is a Remix session.
13+
Returns true if an object is a React Router session.

llm.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8223,7 +8223,7 @@ title: isSession
82238223

82248224
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.isSession.html)
82258225

8226-
Returns true if an object is a Remix session.
8226+
Returns true if an object is a React Router session.
82278227
---
82288228
title: Location
82298229
hidden: true

packages/react-router/__tests__/server-runtime/sessions-test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ describe("Cookie session storage", () => {
182182

183183
expect(spy.console).toHaveBeenCalledTimes(1);
184184
expect(spy.console).toHaveBeenCalledWith(
185-
'The "__session" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://remix.run/utils/cookies#signing-cookies for more information.'
185+
'The "__session" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies for more information.'
186186
);
187187
});
188188
});

packages/react-router/lib/server-runtime/sessions.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface SessionData {
1414
/**
1515
* Session persists data across HTTP requests.
1616
*
17-
* @see https://remix.run/utils/sessions#session-api
17+
* @see https://reactrouter.com/explanation/sessions-and-cookies#sessions
1818
*/
1919
export interface Session<Data = SessionData, FlashData = Data> {
2020
/**
@@ -89,8 +89,6 @@ export type CreateSessionFunction = <Data = SessionData, FlashData = Data>(
8989
*
9090
* Note: This function is typically not invoked directly by application code.
9191
* Instead, use a `SessionStorage` object's `getSession` method.
92-
*
93-
* @see https://remix.run/utils/sessions#createsession
9492
*/
9593
export const createSession: CreateSessionFunction = <
9694
Data = SessionData,
@@ -144,9 +142,9 @@ export const createSession: CreateSessionFunction = <
144142
export type IsSessionFunction = (object: any) => object is Session;
145143

146144
/**
147-
* Returns true if an object is a Remix session.
145+
* Returns true if an object is a React Router session.
148146
*
149-
* @see https://remix.run/utils/sessions#issession
147+
* @see https://reactrouter.com/api/utils/isSession
150148
*/
151149
export const isSession: IsSessionFunction = (object): object is Session => {
152150
return (
@@ -303,7 +301,7 @@ export function warnOnceAboutSigningSessionCookie(cookie: Cookie) {
303301
cookie.isSigned,
304302
`The "${cookie.name}" cookie is not signed, but session cookies should be ` +
305303
`signed to prevent tampering on the client before they are sent back to the ` +
306-
`server. See https://remix.run/utils/cookies#signing-cookies ` +
304+
`server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies ` +
307305
`for more information.`
308306
);
309307
}

0 commit comments

Comments
 (0)