ISession
Implemented by
Index
Properties
cookieJar
optionalfingerprint
readonlyid
optionalproxyInfo
Methods
isUsable
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
Increases usage and error count. Should be used when the session has been used unsuccessfully. For example because of timeouts.
Returns void
markGood
This method should be called after a successful session usage.
Returns void
retire
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
markBadmethod.Returns void
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.