Fix cookie timeout bug