222222except ImportError :
223223 from pickle import dumps , loads
224224
225- import re
225+ import re , warnings
226226
227227__all__ = ["CookieError" ,"BaseCookie" ,"SimpleCookie" ,"SerialCookie" ,
228228 "SmartCookie" ,"Cookie" ]
@@ -682,6 +682,11 @@ class SerialCookie(BaseCookie):
682682 Note: HTTP has a 2k limit on the size of a cookie. This class
683683 does not check for this limit, so be careful!!!
684684 """
685+ def __init__ (self , input = None ):
686+ warnings .warn ("SerialCookie class is insecure; do not use it" ,
687+ DeprecationWarning )
688+ BaseCookie .__init__ (self , input )
689+ # end __init__
685690 def value_decode (self , val ):
686691 # This could raise an exception!
687692 return loads ( _unquote (val ) ), val
@@ -702,6 +707,11 @@ class SmartCookie(BaseCookie):
702707 Note: HTTP has a 2k limit on the size of a cookie. This class
703708 does not check for this limit, so be careful!!!
704709 """
710+ def __init__ (self , input = None ):
711+ warnings .warn ("Cookie/SmartCookie class is insecure; do not use it" ,
712+ DeprecationWarning )
713+ BaseCookie .__init__ (self , input )
714+ # end __init__
705715 def value_decode (self , val ):
706716 strval = _unquote (val )
707717 try :
0 commit comments