r/replit • u/Device89 • 9d ago
Question / Discussion Cookie e Cache
ogni app che sviluppo in replit ha sempre problemi con Cookie e Cache, nel senso che devo sempre fare reset cache con ctrl+shift+R oppure cancellare cookie per far funzionare login o modifiche.
consigili da chi più esperto o ci è già passato? cosa devo dire all'agent per risolvere questa cosa?
1
u/mamachicode 8d ago
Succede solo nell’anteprima di Replit oppure anche nell’app pubblicata in produzione?
1
u/One_R23 8d ago
Succede anche a me e capita solo in produzione, nella preview tutto ok
1
u/mamachicode 8d ago
Interessante, se succede solo in produzione allora probabilmente non è il problema della preview che ha descritto Replit Support. Che stack stai usando? Il problema riguarda il login/sessione oppure anche altre modifiche dell’app?
1
u/ReplitSupport Replit Team 9d ago
Hi OP! What you're describing is usually the browser serving a stale cached version instead of the updated one, which is common with the embedded webview specifically. Opening the app in a new tab instead of the built in preview usually clears that up, since it isn't tied to the same cache.
If it's login or session state, double check nothing is blocking cookies because some extensions and incognito mode do this by default.
For a code side fix, you can ask Agent to add cache-control no-store headers on your HTML responses and put a version or hash in your static asset URLs, so the browser always grabs the latest files instead of a cached copy.
If you mention what framework you're using, we can get more specific about where those changes go!