Link Search Menu Expand Document

Creating a client

To store information about an account session and avoid re-logging in, serialization must be done.

To create the session and set the serialization destination file, do the following:

$MadelineProto = new \danog\MadelineProto\API('session.madeline', $settings); // The session will be serialized to session.madeline

Do the same to load a serialized session:

$MadelineProto = new \danog\MadelineProto\API('session.madeline', $settings);  // The session will be loaded from session.madeline

Next section