[jsoncontroller] deprecate the now unused js_set_cookie (closes #1944810) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 22 Sep 2011 10:04:20 +0200
branchstable
changeset 7824 18ce47d4a17f
parent 7823 5f145462e041
child 7825 7e8c6a7e013e
[jsoncontroller] deprecate the now unused js_set_cookie (closes #1944810)
web/views/basecontrollers.py
--- a/web/views/basecontrollers.py	Thu Sep 22 10:02:25 2011 +0200
+++ b/web/views/basecontrollers.py	Thu Sep 22 10:04:20 2011 +0200
@@ -23,6 +23,7 @@
 _ = unicode
 
 from logilab.common.date import strptime
+from logilab.common.deprecation import deprecated
 
 from cubicweb import (NoSelectableObject, ObjectNotFound, ValidationError,
                       AuthenticationError, typed_eid)
@@ -546,8 +547,8 @@
             self._cw.set_cookie(cookies, statename)
 
     @jsonize
+    @deprecated("[3.13] use jQuery.cookie(cookiename, cookievalue, {path: '/'}) in js land instead")
     def js_set_cookie(self, cookiename, cookievalue):
-        # XXX we should consider jQuery.Cookie
         cookiename, cookievalue = str(cookiename), str(cookievalue)
         cookies = self._cw.get_cookie()
         cookies[cookiename] = cookievalue