Development

#4053 ([PATCH] Session database storage lost the session after it's been regenerated)

You must first sign up to be able to contribute.

Ticket #4053 (closed defect: fixed)

Opened 6 months ago

Last modified 5 months ago

[PATCH] Session database storage lost the session after it's been regenerated

Reported by: nicolas Assigned to: fabien
Priority: major Milestone: 1.1.1
Component: other Version: 1.1.0
Keywords: storage, mysql, database, session Cc: dwhittle
Qualification: Unreviewed

Description

When using a database based session storage, once you manipulate a credential to the current session, the session id is autmatically generated, but not in the database !

So here's a patch that update the session table record according to the new generated session id. I flag this one as major as it's been very hard to debug!

Provided patch is based on symfony 1.1 branch but should be backported to 1.0 and 1.2 if accepted.

Change History

07/22/08 17:03:11 changed by nicolas

  • status changed from new to closed.
  • resolution set to fixed.

(In [10425]) [1.1] closes #4053 - fixed regenerated session id wasn't reflected in database based session storage handlers

07/22/08 17:03:31 changed by nicolas

(In [10426]) [1.2] closes #4053 - fixed regenerated session id wasn't reflected in database based session storage handlers

07/22/08 17:21:11 changed by nicolas

Note: patch applied is a merge from the attached one and fabien's one

07/29/08 19:22:05 changed by warhammerkid

  • status changed from closed to reopened.
  • resolution deleted.

$sql = 'UPDATE '.$db_table.' SET '.$db_id_col.' = ? WHERE $db_id_col = ?'; for sfPDOSessionStorage should read $sql = 'UPDATE '.$db_table.' SET '.$db_id_col.' = ? WHERE '.$db_id_col.' = ?'; in regenerate() method.

07/29/08 21:16:54 changed by warhammerkid

I don't know if this is a result of applying the patch or not, but I'm getting errors with duplicate inserts in the sessionRead method of the sfPDOSessionStorage class. I fixed it by changing line 150 to read: if (($data = $stmt->fetchColumn()) !== false)

07/29/08 21:58:32 changed by nicolas

  • status changed from reopened to closed.
  • resolution set to fixed.

warhammerkid> The patch in attachment was not the one applied on the branches. If you want to patch by yourself your symfony 1.1 instance, use this one instead please:

http://trac.symfony-project.org/changeset/10425?format=diff&new=10425

07/29/08 21:59:41 changed by nicolas

To be safe I've removed the patch in attachment.