Adding cookie logic for sign in