Skip to content

update session documentation links #13448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/plenty-hounds-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-router": patch
---

update session documentation links
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
- infoxicator
- IsaiStormBlesed
- Isammoc
- iskanderbroere
- istarkov
- ivanjeremic
- ivanjonas
Expand Down
2 changes: 1 addition & 1 deletion docs/api/utils/isSession.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ title: isSession

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

Returns true if an object is a Remix session.
Returns true if an object is a React Router session.
2 changes: 1 addition & 1 deletion llm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8223,7 +8223,7 @@ title: isSession

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

Returns true if an object is a Remix session.
Returns true if an object is a React Router session.
---
title: Location
hidden: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ describe("Cookie session storage", () => {

expect(spy.console).toHaveBeenCalledTimes(1);
expect(spy.console).toHaveBeenCalledWith(
'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.'
'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.'
);
});
});
Expand Down
10 changes: 4 additions & 6 deletions packages/react-router/lib/server-runtime/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface SessionData {
/**
* Session persists data across HTTP requests.
*
* @see https://remix.run/utils/sessions#session-api
* @see https://reactrouter.com/explanation/sessions-and-cookies#sessions
*/
export interface Session<Data = SessionData, FlashData = Data> {
/**
Expand Down Expand Up @@ -89,8 +89,6 @@ export type CreateSessionFunction = <Data = SessionData, FlashData = Data>(
*
* Note: This function is typically not invoked directly by application code.
* Instead, use a `SessionStorage` object's `getSession` method.
*
* @see https://remix.run/utils/sessions#createsession
*/
export const createSession: CreateSessionFunction = <
Data = SessionData,
Expand Down Expand Up @@ -144,9 +142,9 @@ export const createSession: CreateSessionFunction = <
export type IsSessionFunction = (object: any) => object is Session;

/**
* Returns true if an object is a Remix session.
* Returns true if an object is a React Router session.
*
* @see https://remix.run/utils/sessions#issession
* @see https://reactrouter.com/api/utils/isSession
*/
export const isSession: IsSessionFunction = (object): object is Session => {
return (
Expand Down Expand Up @@ -303,7 +301,7 @@ export function warnOnceAboutSigningSessionCookie(cookie: Cookie) {
cookie.isSigned,
`The "${cookie.name}" 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 ` +
`server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies ` +
`for more information.`
);
}