API for use cookie as object model. Write at PHP and JS (use YUI3 framework)