added a detection for stale cookies