#  FORK PYROFORK <http://www.gnu.org/licenses/>.

import pyrogram


class ExportSessionString:
    async def export_session_string(
        self: "pyrogram.Client"
    ):
        """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
        :doc:`Storage Engines <../../topics/storage-engines>`.

        Returns:
            ``str``: The session serialized into a printable, url-safe string.

        Example:
            .. code-block:: python

                s = await app.export_session_string()
        """
        return await self.storage.export_session_string()
