Adding cookies to track sidebar state.