# gc

SessionHandlerInterface::gc

Cleanup old sessions

# 

ENTITY

<div data-wrapper="1" role="SessionHandlerInterface">

public

</div>

<div data-wrapper="1" role="SessionHandlerInterface">

int

</div>

<div data-wrapper="1" role="SessionHandlerInterface">

false

</div>

<div data-wrapper="1" role="SessionHandlerInterface">

SessionHandlerInterface::gc

</div>

<div data-wrapper="1" role="SessionHandlerInterface">

int

</div>

<div data-wrapper="1" role="SessionHandlerInterface">

max_lifetime

</div>

Cleans up expired sessions. Called by `session_start`, based on [session.gc_divisor](#ini.session.gc-divisor), [session.gc_probability](#ini.session.gc-probability) and [session.gc_maxlifetime](#ini.session.gc-maxlifetime) settings.

# 

ENTITY

`max_lifetime`  
Sessions that have not updated for the last `max_lifetime` seconds will be removed.

# 

ENTITY

Returns the number of deleted sessions on success, ENTITY. Note this value is returned internally to PHP for processing.

# 

ENTITY

| ENTITY | ENTITY                                                          |
|--------|-----------------------------------------------------------------|
| 7.1.0  | Prior to this version, the function returned ENTITY on success. |