Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
2265 Tampilan

Is it possible to have cross-domains sessions ? After looking at what kind of cookies were stored in the browser I noticed that they are specifically set on the domain. Would it be possible to manually set the domain?
For example, given test.com, foo\.test\.com\ and\ bar.test.com, with three different websites registered in odoo (one per domain) would it be possible to set the session cookie domain to test.com so that the sessionId can be retrieved on the other two subdomain websites too ?

Avatar
Buang
Jawaban Terbai

Bonjour Emanuel,
I know is too late, but I face the same issue latelly.

odoo doesn't seem to specify a domain for cookies, so the requested domain is always used (I guess by the browser). So it's one session per subdomain. 
It might be ok, or not.
If you want to use the same session on every sub domain, you have to set the cookie domain to the parent domain, test dot com in your exemple.
I manage to do this by using this hack on nginx configuration :

# force domain to use parent
proxy_cookie_path / "/;domain=--PARENT-DOMAIN-HERE--";

The session cookie created on either side is shared by both servers, and odoo can read and accept it each time.

I hope it helps !

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Jul 23
1846
0
Jan 24
1657
0
Mei 24
1165
0
Mei 18
4124
3
Sep 21
8698