fixed cookiedirective pattern and tests