Adding more conditions to Cookie handling