Ticket #674 (closed Bug: fixed)
Session DB Driver written property
| Reported by: | alexsancho | Owned by: | Shadowhand |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.2 |
| Component: | Libraries:Session | Version: | SVN HEAD |
| Keywords: | session db driver | Cc: |
Description
Session DB Driver only sets written property when the session exists and the session_id isn't regenerated, IMO the property should be set outside the conditional check.
public function write($id, $data)
{
// Has the session already been written?
if ($this->written)
return TRUE;
$session = array
(
'session_id' => $id,
'last_activity' => time(),
'data' => empty($this->encrypt) ? base64_encode($data) : $this->encrypt->encode($data)
);
// Existing session, with regenerated session id
if ( ! empty($this->old_id))
{
$query = $this->db->update($this->db_table, $session, array('session_id' => $this->old_id));
}
// New session
elseif ($this->new_session)
{
$query = $this->db->insert($this->db_table, $session);
}
// Existing session, without regenerated session id
else
{
// No need to update session_id
unset($session['session_id']);
$query = $this->db->update($this->db_table, $session, array('session_id' => $id));
}
return $this->written = (bool) $query->count();
}
Change History
Note: See
TracTickets for help on using
tickets.
