added cookie handling for buttons