Can someone explain what a session sweeping lottery is? I've attached the default session config file for the Laravel framework.
Questions: 1. It says that some session drivers must manually sweep their storage location. Could someone describe this process and why it is necessary? What session drivers require this action? 2. Why is a lottery necessary? If say some form of storage (database) is full, why does it have to be random? Why can't the framework sweep the old sessions when it detects that the driver is full?
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => array(2, 100),