write and remove cookie from browser in angularjs