Skip to content

Commit cca7bbd

Browse files
i18n(fr): update code snippet in upgrade-to/v5.mdx (#12164)
Co-authored-by: Yan <[email protected]>
1 parent 326a232 commit cca7bbd

File tree

1 file changed

+6
-1
lines changed
  • src/content/docs/fr/guides/upgrade-to

1 file changed

+6
-1
lines changed

src/content/docs/fr/guides/upgrade-to/v5.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ export const onRequest = defineMiddleware(async (context, next) => {
723723
if (payload) {
724724
const { actionName, actionResult } = payload.json();
725725
setActionResult(actionName, actionResult);
726-
context.cookies.delete('ACTION_PAYLOAD');
726+
context.cookies.delete('ACTION_PAYLOAD', { path: '/' });
727727
return next();
728728
}
729729

@@ -735,6 +735,11 @@ export const onRequest = defineMiddleware(async (context, next) => {
735735
context.cookies.set('ACTION_PAYLOAD', {
736736
actionName: action.name,
737737
actionResult: serializeActionResult(actionResult),
738+
}, {
739+
path: '/',
740+
httpOnly: true,
741+
sameSite: 'lax',
742+
maxAge: 60
738743
});
739744

740745
if (actionResult.error) {

0 commit comments

Comments
 (0)