fixed has active class and cookie function