Capturing IP Address & Session in Log File |
I have created a custom handler that allows me to write logs to a database. Now I need to use that same logger to capture the user's IP address and Session related data in the database, as well. Suggestions, please?
To capture the IP Address: $request = \Config\Services::request(); $request->getIPAddress(), I was able to capture session data with: $_SESSION['username'], $_SESSION['user_id'],
If the user is behind a Proxy Server you will have trouble getting their IP Address.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |