Skip to main content
Version: 2.3

SessionOptions

Properties

id

Type: string

Id of session used for generating fingerprints. It is used as proxy session name.


maxAgeSecs

Type: number = 3000

Number of seconds after which the session is considered as expired.


userData

Type: Object<string, *>

Object where custom user data can be stored. For example custom headers.


maxErrorScore

Type: number = 3

Maximum number of marking session as blocked usage. If the errorScore reaches the maxErrorScore session is marked as block and it is thrown away. It starts at 0. Calling the markBad function increases the errorScore by 1. Calling the markGood will decrease the errorScore by errorScoreDecrement


errorScoreDecrement

Type: number = 0.5

It is used for healing the session. For example: if your session is marked bad two times, but it is successful on the third attempt it's errorScore is decremented by this number.


createdAt

Type: Date

Date of creation.


expiresAt

Type: Date

Date of expiration.


usageCount

Type: number = 0

Indicates how many times the session has been used.


errorCount

Type: number = 0

Indicates how many times the session is marked bad.


maxUsageCount

Type: number = 50

Session should be used only a limited amount of times. This number indicates how many times the session is going to be used, before it is thrown away.


sessionPool

Type: SessionPool

SessionPool instance. Session will emit the sessionRetired event on this instance.