Moved inline javascript cookie logic back into js file