def get_cookie_dict(environ):
 header = environ.get('HTTP_COOKIE')
 if (not header):
  return {}
 if ('paste.cookies.dict' in environ):
  (cookies, check_header) = environ['paste.cookies.dict']
  if (check_header == header):
   return cookies
 cookies = SimpleCookie()
 try:
  cookies.load(header)
 except CookieError:
  pass
 result = {}
 for name in cookies:
  result[name] = cookies[name].value
 environ['paste.cookies.dict'] = (result, header)
 return result

def get_cookie_dict ( environ ) : header = environ . get ( 'HTTP_COOKIE' ) if ( not header ) : return { } if ( 'paste.cookies.dict' in environ ) : ( cookies , check_header ) = environ [ 'paste.cookies.dict' ] if ( check_header == header ) : return cookies cookies = SimpleCookie ( ) try : cookies . load ( header ) except CookieError : pass result = { } for name in cookies : result [ name ] = cookies [ name ] . value environ [ 'paste.cookies.dict' ] = ( result , header ) return result
return a *plain* dictionary of cookies as found in the request .