views:

366

answers:

2

In cakePHP, does anyone have any experience creating a custom Session handler that records extra information to the database.

Say you wanted to record the IP and the User Id (if they login using Auth) to the sessions table using a custom handler. Where would you start?

I have seen the cakebook, but it doesn't talk about custom database session handlers.

A: 

Could you give a more specific example? I mean.... your concept is basic cakePHP programming, but I am thinking that you are seeing something that is more specific and seems out of the ordinary....

It is in the CakePHP manual under request handling. The IP is under additional client information.

Take a look -- if you need some help with code, I can post an example later this afternoon... just let me know....

iPhone Guy
I want to record the IP and User Id to the sessions table, and have the "custom" session handler take care of the for me. Is that specific enough?
bucho
How do you override the basic CakePHP database session management to write more info to the database.
bucho
A: 

Apparently it is possible to extend the CakePHP session management. The below links go into some detail but do not provide any concrete examples.

http://bakery.cakephp.org/articles/view/how-to-bend-cakephp-s-session-handling-to-your-needs http://www.mail-archive.com/[email protected]/msg35067.html

Mathew Attlee