Reputation:
How Odoo store the login session when user logged in. I have searched many link but didn't get any satisfied answer. can anyone explain session in odoo.
Upvotes: 14
Views: 9234
Reputation: 16743
Session in odoo v8 is stored in file system. the path of the session is in the default data directory. it can 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
windows 10: C:\Users\<username>\AppData\Local\OpenERP S.A\Odoo\sessions
For Unix, Odoo follows the XDG spec and supports $XDG_DATA_HOME.
That means, by default ~/.local/share/Odoo
Upvotes: 12
Reputation: 1675
In your openerp-server-conf you can define the custom file storage path using the attribute
data_dir = 'Your custom path'
If you need to access the odoo session in your codes, just try following possibilities
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
Cheers !
Upvotes: 7