Add and Edit functional with cookie