I am trying to set cookies to [*never* expire](https://stackoverflow.com/questions/3290424/set-a-cookie-to-never-expire) (even after browser has been closed) in Google App Engine using the documentation for [webapp2 sessions](http://webapp2.readthedocs.io/en/latest/api/webapp2_extras/sessions.html#api-webapp2-extras-sessions) and [building a response](http://webapp2.readthedocs.io/en/latest/guide/response.html). I've tried:

**Code snippet 1:**

```
from webapp2
from webapp2_extras import sessions

class MainHandler(webapp2.RequestHandler):
    def never_expire_session(self):
        sessions.get_session(name='my_session', max_age=2147483647)

    @login_required
    def get(self):
    ....
    html_template = JINJA_ENVIRONMENT.get_template('index.html').render(myapp)
    self.response.out.write(html_template)

```

OR

**Code snippet 2:**

```
class MainHandler(webapp2.RequestHandler):
    def never_expire_session(self):
        return self.response.set_cookie('my_session', max_age=2147483647)

    @login_required
    def get(self):
    ....
    html_template = JINJA_ENVIRONMENT.get_template('index.html').render(myapp)
    self.never_expire_session()
    self.response.out.write(html_template)

```

Code Snippet 2 results in a response of `NoneNone`. (Not sure the output of the first code snippet.)

I have also tried the answer [here](https://stackoverflow.com/questions/39335513/set-up-multiple-session-handlers-on-python-webapp2), that recommends configuring the parameters:

```
config = {}
config['webapp2_extras.sessions'] = {'session_max_age': 2147483647}
....
....
app = webapp2.WSGIApplication([
....
], debug=True, config=config)

```

I've cleared my cookies, restarted my browser, and checked the console and the cookie value shows as a randomly generated sequence of numbers and letters and the expiration of the cookie is set to one year from `datetime.now`. Nothing I've tried works.

How can I correctly set the session cookie so it never expires, even on browser exit?