Added cookie-based authentication control.