How does Odoo store a session?

How Odoo stores a login session when a user logs in. I searched a lot of links but did not get a satisfactory answer. can someone explain the session in an ode.

+7
session openerp
source share
2 answers

A session in odoo v8 is stored in the file system . The session path is in the default data directory. it could be

Mac OS X: ~/Library/Application Support/odoo Unix: ~/.local/share/odoo Win XP: C:\Documents and Settings\<username>\Local Settings\Application Data\<AppAuthor>\odoo Win 7: C:\Users\<username>\AppData\Roaming\<AppAuthor>\odoo 

For Unix, Odu follows the XDG specifications and supports $ XDG_DATA_HOME. This means that deafult ~/.local/share/Odoo

+6
source share

In your openerp-server-conf you can define the path to store the user file using the attribute

 data_dir = 'Your custom path' 

If you need to access an odoo session in your codes, just try the following options.

in python script:

  session = env['ir.sessions'] or session = request.session or you can get session info from the route '/web/session/get_session_info' ie, @http.route('/web/session/get_session_info',type='json',auth="none") def get_session_info(self): request.uid = request.session.uid request.disable_db = False return self.session_info() 

In js

 try to Implement operations on var session = require('web.session'); this session object 

Greetings!

+1
source share

All Articles