Export the current authorized session as a serialized string.
Session strings are useful for storing in-memory authorized sessions in a portable, serialized string. More detailed information about session strings can be found at the dedicated page of Storage Engines.
str– The session serialized into a printable, url-safe string.
from pyrogram import Client app = Client("my_account") with app: print(app.export_session_string())