Odoo Help


How to get HTTP Session OpenERP

on 9/12/13, 2:40 PM 1,707 views

Hi, I wonder if there is any way to get the parameters of the session from python code.

My intention is to determine the client's IP, scanning the meeting OpenERP code in the main.py file in addons \ web \ controllers \ there is a method called authenticate and stored in the selft.session_info (thing) the information about the remote IP 'REMOTE_ADDR'.

there any way to get from the python code that session_info information?.


req = httplib2.Http() webauth = self.url + "/web/session/get_session_info" body ={"jsonrpc":"2.0","method":"call","params":{"session_id":self.session_id,"context":{}},"id":"r1"} headers = {"Content-Type": "Application/json"} resp, content = req.request(webauth, "POST", json.dumps(body), headers)

on 9/24/14, 9:49 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/12/13, 2:40 PM
Seen: 1707 times
Last updated: 3/16/15, 8:10 AM