# Handler

class Handler

Session Handler

## Properties

protected IDatabase | $_db | Session Database Mapper |
protected integer | $_lifetime | Session GC Lifetime |
protected string | $_sessionId | Session Id |

## Methods

__construct(IDatabase $db, $sessionId = null, $sessionName = "jtlConnector")

Constructor

boolean
check(string $sessionId)

Checks if Session is Valid

open($savePath, $sessionName)

Open Session

close()

Close Sesssion

read($sessionId)

Read Session

write($sessionId, $sessionData)

Write Session

destroy($sessionId)

Destroy Session

gc($maxLifetime)

Garbage Collector

string
getSessionId()

SessionId Getter

number
getLifetime()

Lifetime Getter

## Details

###
at line 51
`__construct(IDatabase $db, $sessionId = null, $sessionName = "jtlConnector")`

Constructor

#### Parameters

IDatabase | $db |
| $sessionId | Connector session ID
| $sessionName | PHP session Name

#### Exceptions

SessionException |

###
at line 107
`boolean check(string $sessionId)`

Checks if Session is Valid

#### Parameters

string | $sessionId |

#### Return Value

boolean |

###
at line 132
`open($savePath, $sessionName)`

Open Session

#### Parameters

| $savePath |
| $sessionName |

###
at line 144
`close()`

Close Sesssion

###
at line 154
`read($sessionId)`

Read Session

#### Parameters

| $sessionId |

###
at line 178
`write($sessionId, $sessionData)`

Write Session

#### Parameters

| $sessionId |
| $sessionData |

###
at line 217
`destroy($sessionId)`

Destroy Session

#### Parameters

| $sessionId |

###
at line 229
`gc($maxLifetime)`

Garbage Collector

#### Parameters

| $maxLifetime |

###
at line 241
`string getSessionId()`

SessionId Getter

#### Return Value

string |

###
at line 251
`number getLifetime()`

Lifetime Getter

#### Return Value

number |