MadelineProto/docs/TD_docs/constructors/session.md

2.5 KiB

title description
session Contains information about one session in some application used by the user

Constructor: session

Back to constructors index

Contains information about one session in some application used by the user

Attributes:

Name Type Required Description
id long Yes Session identifier
is_current Bool Yes True, if it is current session
app_id int Yes Application identifier, provided by the application
app_name string Yes Name of the application, provided by the application
app_version string Yes Version of the application, provided by the application
is_official_app Bool Yes True, if the application is an official application or uses the app_id of some official application
device_model string Yes Model of a device application is runned on, provided by the application
platform string Yes Operating system application is runned on, provided by the application
system_version string Yes Version of operating system application is runned on, provided by the application
date_created int Yes Date the user has logged in, unix time
date_active int Yes Date the session was used last time, unix time
ip string Yes An ip address from which session was created in a human-readable format
country string Yes Two-letter country code from which session was created based on the ip
region string Yes Region code from which session was created based on the ip

Type: Session

Example:

$session = ['_' => 'session', 'id' => long, 'is_current' => Bool, 'app_id' => int, 'app_name' => string, 'app_version' => string, 'is_official_app' => Bool, 'device_model' => string, 'platform' => string, 'system_version' => string, 'date_created' => int, 'date_active' => int, 'ip' => string, 'country' => string, 'region' => string, ];

Or, if you're into Lua:

session={_='session', id=long, is_current=Bool, app_id=int, app_name=string, app_version=string, is_official_app=Bool, device_model=string, platform=string, system_version=string, date_created=int, date_active=int, ip=string, country=string, region=string, }