I think putting this in a model file should do it:

response.cookies['session_id_<appname>']['domain'] = '.example.com'

Have you tried it?

On Friday, 6 December 2013 10:28:44 UTC-6, Marin Pranjić wrote:
>
> For example, if I login on *www1.example.com <http://www1.example.com>*, 
> I also want to be logged in *www2.example.com <http://www2.example.com>*.
>
> The code that Leonel provided would work. However, I am not setting a 
> custom cookie (thanks anyway).
> I want to do it for session cookie.
> And I'm only asking where should I put that code.
>
> Would it be wrong if I put it in model, so it's executed on every request?
>
> something like:
>
> response.cookies['session_id_<appname>']['domain'] = '.example.com'
>
> Is there a better place to put this code?
>
> Dana petak, 6. prosinca 2013. 16:48:22 UTC+1, korisnik Massimo Di Pierro 
> napisao je:
>>
>> I do not understand what you are trying to do.
>>
>> On Thursday, 5 December 2013 13:22:08 UTC-6, Marin Pranjić wrote:
>>>
>>> Hi,
>>>
>>> I have two subdomains for one app, and I need to use both.
>>> So I have to set "Domain" header in session cookie to the domain root (.
>>> domain.com).
>>> Where should I put that code? Not sure how exactly to do it for session 
>>> cookie.
>>>
>>> Marin
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to