Lightbox with cookies not working when back button is pressed