Refactored cookie value and login