def make_cookie(name, value, max_age=None, path='/', domain=None, secure=False, httponly=False, comment=None):
 if (value is None):
  value = ''
  max_age = 0
  expires = 'Wed, 31-Dec-97 23:59:59 GMT'
 elif isinstance(max_age, timedelta):
  max_age = ((((max_age.days * 60) * 60) * 24) + max_age.seconds)
  expires = max_age
 else:
  expires = max_age
 morsel = Morsel(name, value)
 if (domain is not None):
  morsel.domain = bytes_(domain)
 if (path is not None):
  morsel.path = bytes_(path)
 if httponly:
  morsel.httponly = True
 if secure:
  morsel.secure = True
 if (max_age is not None):
  morsel.max_age = max_age
 if (expires is not None):
  morsel.expires = expires
 if (comment is not None):
  morsel.comment = bytes_(comment)
 return morsel.serialize()

def make_cookie ( name , value , max_age = None , path = '/' , domain = None , secure = False , httponly = False , comment = None ) : if ( value is None ) : value = '' max_age = 0 expires = 'Wed, 31-Dec-97 23:59:59 GMT' elif isinstance ( max_age , timedelta ) : max_age = ( ( ( ( max_age . days * 60 ) * 60 ) * 24 ) + max_age . seconds ) expires = max_age else : expires = max_age morsel = Morsel ( name , value ) if ( domain is not None ) : morsel . domain = bytes_ ( domain ) if ( path is not None ) : morsel . path = bytes_ ( path ) if httponly : morsel . httponly = True if secure : morsel . secure = True if ( max_age is not None ) : morsel . max_age = max_age if ( expires is not None ) : morsel . expires = expires if ( comment is not None ) : morsel . comment = bytes_ ( comment ) return morsel . serialize ( )
create and return a cookie .