Commits

Robert Brewer committed 006c64a

Changed "simple_cookie" to just "cookie".

Comments (0)

Files changed (3)

cherrypy/_cprequest.py

     # Message attributes
     header_list = []
     headers = http.HeaderMap()
-    simple_cookie = Cookie.SimpleCookie()
+    cookie = Cookie.SimpleCookie()
     rfile = None
     process_request_body = True
     methods_with_bodies = ("POST", "PUT")
             self.header_list = list(headers)
             self.rfile = rfile
             self.headers = http.HeaderMap()
-            self.simple_cookie = Cookie.SimpleCookie()
+            self.cookie = Cookie.SimpleCookie()
             self.handler = None
             
             # Get the 'Host' header, so we can do HTTPRedirects properly.
             
             # Warning: if there is more than one header entry for cookies (AFAIK,
             # only Konqueror does that), only the last one will remain in headers
-            # (but they will be correctly stored in request.simple_cookie).
+            # (but they will be correctly stored in request.cookie).
             if "=?" in value:
                 dict.__setitem__(headers, name, http.decode_TEXT(value))
             else:
             # Handle cookies differently because on Konqueror, multiple
             # cookies come on different lines with the same key
             if name == 'Cookie':
-                self.simple_cookie.load(value)
+                self.cookie.load(value)
         
         if not dict.__contains__(headers, 'Host'):
             # All Internet-based HTTP/1.1 servers MUST respond with a 400
     status = ""
     header_list = []
     headers = http.HeaderMap()
-    simple_cookie = Cookie.SimpleCookie()
+    cookie = Cookie.SimpleCookie()
     body = Body()
     time = None
     timeout = 300
             "Server": "CherryPy/" + cherrypy.__version__,
             "Date": http.HTTPDate(self.time),
         })
-        self.simple_cookie = Cookie.SimpleCookie()
+        self.cookie = Cookie.SimpleCookie()
     
     def collapse_body(self):
         newbody = ''.join([chunk for chunk in self.body])
         # Transform our header dict into a list of tuples.
         self.header_list = h = headers.output(cherrypy.request.protocol)
         
-        cookie = self.simple_cookie.output()
+        cookie = self.cookie.output()
         if cookie:
             for line in cookie.split("\n"):
                 name, value = line.split(": ", 1)

cherrypy/lib/sessions.py

     
     # Check if request came with a session ID
     id = None
-    if name in request.simple_cookie:
-        id = request.simple_cookie[name].value
+    if name in request.cookie:
+        id = request.cookie[name].value
     
     if not hasattr(cherrypy, "session"):
         cherrypy.session = cherrypy._ThreadLocalProxy('session', _def_session)
         sess.acquire_lock()
     
     # Set response cookie
-    cookie = cherrypy.response.simple_cookie
+    cookie = cherrypy.response.cookie
     cookie[name] = sess.id
     cookie[name]['path'] = path or request.headers.get(path_header) or '/'
     
     one_year = 60 * 60 * 24 * 365
     exp = time.gmtime(time.time() - one_year)
     t = time.strftime("%a, %d-%b-%Y %H:%M:%S GMT", exp)
-    cherrypy.response.simple_cookie[name]['expires'] = t
+    cherrypy.response.cookie[name]['expires'] = t
 

cherrypy/test/test_core.py

     class Cookies(Test):
         
         def single(self, name):
-            cookie = cherrypy.request.simple_cookie[name]
-            cherrypy.response.simple_cookie[name] = cookie.value
+            cookie = cherrypy.request.cookie[name]
+            cherrypy.response.cookie[name] = cookie.value
         
         def multiple(self, names):
             for name in names:
-                cookie = cherrypy.request.simple_cookie[name]
-                cherrypy.response.simple_cookie[name] = cookie.value
+                cookie = cherrypy.request.cookie[name]
+                cherrypy.response.cookie[name] = cookie.value
 
 
     class ThreadLocal(Test):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.