Feature Request #2311

Signed Cookies

Added by Mathew Davies over 2 years ago. Updated over 2 years ago.

Status:Closed Start date:11/04/2009
Priority:Immediate Due date:
Assignee:Isaiah DeRose-Wilson % Done:

0%

Category:Helpers
Target version:2.4
Resolution:fixed Points:

Description

At the moment the auto login feature of auth uses cookies so people can be automatically logged in. These cookies are not protected and if stolen, can result in the comprise of someones account. I've patched the cookie helper to add support for signed cookies.

However, I have not figured out how to adapt the sessions library.

Patch included.

signed-cookies.diff (6.2 kB) Mathew Davies, 11/04/2009 10:57 pm

signed-cookies-improved.diff (3.7 kB) Mathew Davies, 11/05/2009 01:46 pm

Associated revisions

Revision 4659
Added by Isaiah DeRose-Wilson over 2 years ago

Added signed cookies (ported from Kohana3), thanks Mathew! refs #2311

Revision 4660
Added by Isaiah DeRose-Wilson over 2 years ago

Corrected comment about the cookie.httponly setting. Refs #2311

Revision 4661
Added by Isaiah DeRose-Wilson over 2 years ago

Follow up to r4659, fixes #2311

History

Updated by Mathew Davies over 2 years ago

Improved patch, fixed sessions bug.

Updated by Mathew Davies over 2 years ago

Side note, it may be wise to remove the cookie method from the input library as it sends back the hashed string with value and may cause more API breakage than you'd originally of liked.

You could even just re-route it to use cookie::get instead.

Updated by Isaiah DeRose-Wilson over 2 years ago

  • Status changed from New to Assigned
  • Assignee set to Isaiah DeRose-Wilson
  • 11 changed from 2.3.4 to SVN HEAD

Updated by Isaiah DeRose-Wilson over 2 years ago

The input class needs to be updated to use cookie::get() instead of using $_COOKIE directly. With signed cookies you can't use the cookie helper to create the cookie and than access it using $_COOKIE. If you want signed cookies you have to use the cookie helper for everything. If you don't want to use signed cookies you have to use the $_COOKIE global directly.

Updated by Isaiah DeRose-Wilson over 2 years ago

  • Status changed from Assigned to Closed
  • Resolution set to fixed

Updated the Input::cookie() function to use cookie::get() instead of $_COOKIE

Also available in: Atom PDF