Updated to also allow for checking of session cookie