from bungeni.alchemist.session import session s = session.create_session('my_session', 3600) # Session name and expiration time in seconds s.set('username', 'Alice') # Saving data to the session
from bungeni.alchemist.session import session s = session.get_session('my_session') username = s.get('username') # Retrieving data from the session s.set('username', 'Bob') # Updating data in the sessionIn both examples, we can see that the bungeni.alchemist Session Session package library is being used to create, retrieve, and update data in a session.