Fix 'data loss on session expiry' issue