Added cookie handling.