disable session auto start in CakePHP 1.19

RESOLVED FIXED in 3.1

Status

defect
--
blocker
RESOLVED FIXED
11 years ago
3 years ago

People

(Reporter: morgamic, Assigned: clouserw)

Tracking

Dependency tree / graph

Details

Attachments

(2 attachments)

Reporter

Description

11 years ago
Cake is starting sessions on every request, causing the cake_sessions table to spiral out of control then lock up when garbage collection is invoked.

This is why we rolled back the latest update on the 3.1 branch in bug 420350.  This blocks that update.
Reporter

Updated

11 years ago
Assignee: nobody → morgamic
Reporter

Updated

11 years ago
Status: NEW → ASSIGNED
Reporter

Updated

11 years ago
Assignee: morgamic → clouserw
Status: ASSIGNED → NEW
Reporter

Comment 1

11 years ago
Wil has been workin on it.
Status: NEW → ASSIGNED
Assignee

Comment 2

11 years ago
Posted patch fix sessionsSplinter Review
Cake is bypassing the constructors and calling startUp() on all it's components.  That means our little cookie check didn't work anymore.  I added the check to the __start() function as well as fixed up some other code.  The code is commented, so I won't go over it all again here.
Attachment #307434 - Flags: review?
Reporter

Comment 3

11 years ago
Comment on attachment 307434 [details] [diff] [review]
fix sessions

Looks good and works for me.
Attachment #307434 - Flags: review? → review+
Assignee

Comment 4

11 years ago
r10970
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Reporter

Comment 5

11 years ago
We should merge this onto 3.1 in the AM.
Assignee

Comment 6

11 years ago
(In reply to comment #5)
> We should merge this onto 3.1 in the AM.
> 

Ok, patch is on 3.1, r11010.  Is there a stage for 3.1, or can someone test it?
Assignee

Comment 7

11 years ago
We had some complaints about people having to clear cookies before being able to log in.  I did some more investigation and ran across another fix.

When we start sessions manually we were starting them with a path of '/', but when we asked Cake to destroy the session it was trying to destroy a cookie with (possibly) another path.  That means the cookies wouldn't go away, but the sessions would, so the cookie existed but the session didn't.

The Session component is a special case in Cake and gets manually tweaked with the components are loading.  I stole the code that figures out the base path when the components are loading and stuck it in when we manually start a session so the paths should be equivalent.
Attachment #307833 - Flags: review?(morgamic)
Assignee

Updated

11 years ago
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to comment #7)
> Created an attachment (id=307833) [details]
> fix cookie paths
> 
> We had some complaints about people having to clear cookies before being able
> to log in.  I did some more investigation and ran across another fix.
> 
> When we start sessions manually we were starting them with a path of '/', but
> when we asked Cake to destroy the session it was trying to destroy a cookie
> with (possibly) another path.  That means the cookies wouldn't go away, but the
> sessions would, so the cookie existed but the session didn't.
> 
> The Session component is a special case in Cake and gets manually tweaked with
> the components are loading.  I stole the code that figures out the base path
> when the components are loading and stuck it in when we manually start a
> session so the paths should be equivalent.

I filed this separately as bug 421223...
Assignee

Updated

11 years ago
Blocks: 421223
Reporter

Comment 9

11 years ago
Comment on attachment 307833 [details] [diff] [review]
fix cookie paths

Works for me with old cookies.
Attachment #307833 - Flags: review?(morgamic) → review+
Assignee

Comment 10

11 years ago
Thanks Mike.  r11051
Status: REOPENED → RESOLVED
Last Resolved: 11 years ago11 years ago
Resolution: --- → FIXED
Reporter

Comment 11

11 years ago
This was pushed 3/6, 8pm.
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.