Is there a way to add a column in the session table (using MySQL) to
record the requester’s IP address?
Or possibly extend the session code to write to another table or log
file that I could use to correlate session and requester IP address.
I need this short term for a debugging task.
The easiest way may be to add a “before_filter”,
class ApplicationController < ActionController::Base
session[:request_ip] = request.remote_ip
rest of your ApplicationController code
Then read back the value from session[:request_ip] as needed.
The requester’s IP may change from request to request, if they have
IP’s assigned dynamically, for example. Not quite clear how this would
be a “short term debugging requirement”. Also may require browser has
“cookies enabled”, depending on what you’re up to.
On Apr 11, 4:25 pm, Greg W. [email protected]