import http.cookies
import http.cookiejar
cookiejar = http.cookiejar.LWPCookieJar()
br = mechanize.Browser()
br.set_cookiejar(cookiejar)
cookie = http.cookiejar.Cookie(version=0, name='PON', value='xxx.xxx.xxx.111',
    expires=365, port=None, port_specified=False, domain='xxxx',
    domain_specified=True, domain_initial_dot=False, path='/',
    path_specified=True, secure=True, discard=False, comment=None,
    comment_url=None, rest={'HttpOnly': False}, rfc2109=False)
cookiejar.set_cookie(cookie)
how to set cookie in python mechanize