Changeset 1302
- Timestamp:
- 08/30/06 16:54:42
- Files:
-
- trunk/cherrypy/_cprequest.py (modified) (7 diffs)
- trunk/cherrypy/lib/sessions.py (modified) (3 diffs)
- trunk/cherrypy/test/test_core.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cprequest.py
r1296 r1302 284 284 header_list = [] 285 285 headers = http.HeaderMap() 286 simple_cookie = Cookie.SimpleCookie()286 cookie = Cookie.SimpleCookie() 287 287 rfile = None 288 288 process_request_body = True … … 403 403 self.rfile = rfile 404 404 self.headers = http.HeaderMap() 405 self. simple_cookie = Cookie.SimpleCookie()405 self.cookie = Cookie.SimpleCookie() 406 406 self.handler = None 407 407 … … 498 498 # Warning: if there is more than one header entry for cookies (AFAIK, 499 499 # only Konqueror does that), only the last one will remain in headers 500 # (but they will be correctly stored in request. simple_cookie).500 # (but they will be correctly stored in request.cookie). 501 501 if "=?" in value: 502 502 dict.__setitem__(headers, name, http.decode_TEXT(value)) … … 507 507 # cookies come on different lines with the same key 508 508 if name == 'Cookie': 509 self. simple_cookie.load(value)509 self.cookie.load(value) 510 510 511 511 if not dict.__contains__(headers, 'Host'): … … 704 704 header_list = [] 705 705 headers = http.HeaderMap() 706 simple_cookie = Cookie.SimpleCookie()706 cookie = Cookie.SimpleCookie() 707 707 body = Body() 708 708 time = None … … 725 725 "Date": http.HTTPDate(self.time), 726 726 }) 727 self. simple_cookie = Cookie.SimpleCookie()727 self.cookie = Cookie.SimpleCookie() 728 728 729 729 def collapse_body(self): … … 758 758 self.header_list = h = headers.output(cherrypy.request.protocol) 759 759 760 cookie = self. simple_cookie.output()760 cookie = self.cookie.output() 761 761 if cookie: 762 762 for line in cookie.split("\n"): trunk/cherrypy/lib/sessions.py
r1287 r1302 383 383 # Check if request came with a session ID 384 384 id = None 385 if name in request. simple_cookie:386 id = request. simple_cookie[name].value385 if name in request.cookie: 386 id = request.cookie[name].value 387 387 388 388 if not hasattr(cherrypy, "session"): … … 401 401 402 402 # Set response cookie 403 cookie = cherrypy.response. simple_cookie403 cookie = cherrypy.response.cookie 404 404 cookie[name] = sess.id 405 405 cookie[name]['path'] = path or request.headers.get(path_header) or '/' … … 423 423 exp = time.gmtime(time.time() - one_year) 424 424 t = time.strftime("%a, %d-%b-%Y %H:%M:%S GMT", exp) 425 cherrypy.response. simple_cookie[name]['expires'] = t426 425 cherrypy.response.cookie[name]['expires'] = t 426 trunk/cherrypy/test/test_core.py
r1294 r1302 347 347 348 348 def single(self, name): 349 cookie = cherrypy.request. simple_cookie[name]350 cherrypy.response. simple_cookie[name] = cookie.value349 cookie = cherrypy.request.cookie[name] 350 cherrypy.response.cookie[name] = cookie.value 351 351 352 352 def multiple(self, names): 353 353 for name in names: 354 cookie = cherrypy.request. simple_cookie[name]355 cherrypy.response. simple_cookie[name] = cookie.value354 cookie = cherrypy.request.cookie[name] 355 cherrypy.response.cookie[name] = cookie.value 356 356 357 357

