def regen(self):
        """Regenerate the session, storing yellow color in it."""
        cherrypy.session.regenerate()
        # Must modify data or the session will not be saved.
        cherrypy.session['color'] = 'yellow'
        return self.page()
Regenerate the session, storing yellow color in it.
cherrypy/test/sessiondemo.py