Skip to main content
Version: Next

ISession

Sessions are used to store information such as cookies and can be used for generating fingerprints and proxy sessions. You can imagine each session as a specific user, with its own cookies, IP (via proxy) and potentially a unique browser fingerprint. Session internal state can be enriched with custom user data for example some authorization tokens and specific headers in general.

Implemented by

Index

Properties

cookieJar

cookieJar: CookieJar

optionalfingerprint

fingerprint?: SessionFingerprint

readonlyid

id: string

optionalproxyInfo

proxyInfo?: ProxyInfo

Methods

isUsable

  • isUsable(): boolean
  • Indicates whether the session can be used for next requests. Session is usable when it is not expired, not blocked and the maximum usage count has not been reached.


    Returns boolean

markBad

  • markBad(): void
  • Increases usage and error count. Should be used when the session has been used unsuccessfully. For example because of timeouts.


    Returns void

markGood

  • markGood(): void
  • This method should be called after a successful session usage.


    Returns void

retire

  • retire(): void
  • Marks session as blocked. This method should be used if the session usage was unsuccessful and you are sure that it is because of the session configuration and not any external matters. For example when server returns 403 status code. If the session does not work due to some external factors as server error such as 5XX you probably want to use markBad method.


    Returns void