[mod_python] Session management implementation in mod_python

Martijn Moeling martijn at xs4us.nu
Tue Mar 9 04:40:09 EST 2010


Are the different webapps in different paths?
besides c.domain, you also need/can set c.path = "/" (or whatever path, "/" might do the trick)

since normally with the original Session.py is t's just adding PythonOption mod_python.session.application_path

You need to set it to the same path in every index.py

Martijn

On Mar 9, 2010, at 10:24 AM, K.Manikandan wrote:

>> 8<--------------
>> with Session code implementing following in make_cookie() method:
>> 
>>        if config.has_key("mod_python.Session.application_domain"):
>>            c.domain = config["mod_python.Session.application_domain"]
>> 8<--------------
>> 
>> So look up the part where you create the cookie and set
>> "YOUR_COOKIE_OBJECT.domain = ".domain.com"
>> Which is sort of the same as using the Python option in the code above.
>> 
>> That should do the trick!
>> 
>> Martijn
> 
> hi, sorry for that. here is my cookie snippet.
> 
> This is in the index.py of webapp1.
> 
> c = Cookie.Cookie('name','Manikandan')
> c.domain = '.cs.tcenet'
> Cookie.add_cookie(req,c)
> 
> Here, i set the cookie with domain as given. Now in index.py inside
> another web application in the same domain, I create another cookie for
> this new webapp.
> 
> c = Cookie.Cookie('Other','Guru')
> c.domain = '.cs.tcenet'
> Cookie.add_cookie(req,c)
> 
> In the new webapp i access the cookie as
> 
> c = Cookie.get_cookies(req)
> 
> I get only the {other:guru} cookie but not the {name:mani}. In the first
> webapp i get {name:mani} but not the {other:guru}.
> 
> Now I want to access the {name:mani} in the new webapp. Please suggest a
> way to do it...
> 
> Regards,
> Manikandan K
> 
> 
> 
> 
> 
> -----------------------------------------
> This email was sent using TCEMail Service.
> Thiagarajar College of Engineering
> Madurai-625 015, India
> 




More information about the Mod_python mailing list