In the flask, a session object is used to track the session data which is a dictionary object that contains a key-value pair of the session variables and their associated values . The following syntax is used to set the session variable to a specific value on the server.