protected function generateSession()
{
$time = time();
// Generate the cookie hash
$this->strHash = $this->getSessionHash($this->strCookie);
// Clean up old sessions
$this->Database->prepare("DELETE FROM tl_session WHERE tstamp<? OR hash=?")->execute($time - \Config::get('sessionTimeout'), $this->strHash);
// Save the session in the database
$this->Database->prepare("INSERT INTO tl_session (pid, tstamp, name, sessionID, ip, hash) VALUES (?, ?, ?, ?, ?, ?)")->execute($this->intId, $time, $this->strCookie, \System::getContainer()->get('session')->getId(), $this->strIp, $this->strHash);
// Set the authentication cookie
$this->setCookie($this->strCookie, $this->strHash, $time + \Config::get('sessionTimeout'), null, null, \Environment::get('ssl'), true);
}