Added support for cookies and HTML5 local storage