Closed GrahamQuan closed 1 month ago
When using browser navigate back & forward & refresh, url locale & cookie locale not sync, Is it expected?
/en/blog
/ja/blog
/pricing
/ja/pricing
back
en
ja
/blog
using browser navigate will make locale mess
We can't really listen to router.event cause next13 /app remove it, which means we can't modify cookie locale when use browser back & forward, see https://github.com/vercel/next.js/discussions/41934
router.event
/app
App Router
use broswer back & forword & refresh, url locale & cookie will sync
Description
[Bug]
When using browser navigate back & forward & refresh, url locale & cookie locale not sync, Is it expected?
[Behavior]
/en/blog
/ja/blog
/pricing
, now/ja/pricing
back
button 2 times on the top menu, now is/en/blog
(url locale will been
, but cookie locale is stillja
)/pricing
page, go to/ja/pricing
since cookie isja
or maybe cache?/blog
page, go to/ja/blog
or/en/blog
(yes this will be 2 results)[Basically]
using browser navigate will make locale mess
[Next13 remove router event]
We can't really listen to
router.event
cause next13/app
remove it, which means we can't modify cookie locale when use browser back & forward, see https://github.com/vercel/next.js/discussions/41934[version]
Verifications
Mandatory reproduction URL
App Router
Reproduction description
[Behavior]
/en/blog
/ja/blog
/pricing
, now/ja/pricing
back
button 2 times on the top menu, now is/en/blog
(url locale will been
, but cookie locale is stillja
)/pricing
page, go to/ja/pricing
since cookie isja
or maybe cache?/blog
page, go to/ja/blog
or/en/blog
(yes this will be 2 results)Expected behaviour
use broswer back & forword & refresh, url locale & cookie will sync