Added SESSION_COOKIE_PERMANENT configuration to control whether we initialize the session to be permanent or not.