def get_cookies(environ):
 header = environ.get('HTTP_COOKIE', '')
 if ('paste.cookies' in environ):
  (cookies, check_header) = environ['paste.cookies']
  if (check_header == header):
   return cookies
 cookies = SimpleCookie()
 try:
  cookies.load(header)
 except CookieError:
  pass
 environ['paste.cookies'] = (cookies, header)
 return cookies

def get_cookies ( environ ) : header = environ . get ( 'HTTP_COOKIE' , '' ) if ( 'paste.cookies' in environ ) : ( cookies , check_header ) = environ [ 'paste.cookies' ] if ( check_header == header ) : return cookies cookies = SimpleCookie ( ) try : cookies . load ( header ) except CookieError : pass environ [ 'paste.cookies' ] = ( cookies , header ) return cookies
gets a cookie object from the request environment; caches this value in case get_cookies is called again for the same request .