[mod_python] mod_python session p roblem

Jim Gallacher jpg at jgassociates.ca
Sun Apr 2 11:51:37 EDT 2006


The code you show here looks OK, so I'm not sure what the problem may be.

So is a new session created for every request, where you always see "0"
returned in the response? Or do you sometimes see some number greater
than "0", and then sometimes "0"? This is unclear in your original
message as well.

Is there anything in the apache error log indicating a problem?

Jim


yjfuk wrote:
> I mean refresh,e.g. press F5 in the IE
>  

> 
> yjfuk wrote:
> 
>>code below:
>>from mod_python import Session
>>def index(req)
>>  sess=Session.Session(req)
>>  if sess.is_new():
>>    sess['num']=0
>>    sess.save()
>>  else:
>>    sess['num']+=1
>>    sess.save()
>>    req.write(str(sess['num']))
>> 
>> 
>>when I reflush the browser some times ,the session is usually lost .
>>I run it in windows XP(sp2),python 2.4.2, mod_python 3.2.8 
> 
> 
> Does reflush mean refresh or restart?
> 
> Jim
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python



More information about the Mod_python mailing list