Closed matthewp closed 1 year ago
Provides a simpler API for getting and setting cookie values through a Map-like interface:
--- const prefs = Astro.cookies.get('prefs').json(); --- <body data-theme={prefs.darkMode ? 'dark' : 'light'}>
And setting:
--- Astro.cookies.set('prefs', { darkMode: true }, { expires: '1 month' }); ---
This was accepted on our community call!
Summary
Provides a simpler API for getting and setting cookie values through a Map-like interface:
And setting:
Links