Thanks Massimo for your inmediate answer! I checked what you said, and 
there was browser-cookie problem in deed... I was using Chromium, and don't 
know why I didn't try with Firefox, I should've done that before asking 
here, my bad.

Anyway, I deleted the cookie that Chromium was storing for my server in 
production, and everything started to work ok. In Firefox it was working 
ok, no need to delete cookies. However, this brought me a couple of doubts:

1) I'm using a session variable to show a splash advertisement only one 
time in the user's session. Visitors of my site use primarily Chromium, and 
considering what happened to me, I'm concerned about them seeing splash 
advertisement over and over again (until they delete the cookie). ¿Can I do 
something to prevent it? I mean, from my source code, considering the user 
won't delete his cookies.

2) *I was already having a related problem*: server in production, web2py + 
lighttpd, system running for a couple of months, ocassionally I logged in 
to do some admin works.. One day I couldn't log in: the login form accepted 
my mail and password, but I was redirected to home (as if I had been logged 
in) but system didn't log me in.  Since that, I was forced to delete 
Chromium cookies to properly login to my account.  Firefox didn't have the 
problem.   I guess it could be a Chromium cookie problem, however I never 
had problems with chromium and cookies, only this cases with web2py, so I 
thought it was worth to mention it.


El sábado, 27 de abril de 2013 13:31:48 UTC-3, Massimo Di Pierro escribió:
>
> I cannot reproduce this and, in fact, if this were broke nothing in web2py 
> would work since everything relies on sessions.
> There are some possibilities:
> 1) your browser has cookies disabled (so sessions are re-issued at every 
> request)
> 2) there is a proxy in between that deletes session cookies
> 3) there is something in your code that prevents saving of sessions, for 
> example session._forget()
>
>
>
>
> On Saturday, 27 April 2013 11:23:30 UTC-5, Lisandro wrote:
>>
>> What I need:  to set a flag first time user hits the index in the 
>> session. My code is really simple:
>>
>> def index():
>>     if not session.myvariable:
>>         session.myvariable = True
>>         response.flash = 'I just wrote myvariable'
>>     else:  
>>         response.flash = 'myvariable is %s' %session.myvariable
>>
>> Expected behaviour: first time the function is accessed the message "i 
>> just wrote myvariable" is shown.. the every time the function is accessed 
>> message "myvariable is True" is shown (until restart of session, for 
>> example restarting the browser).
>>
>> When i work on local mode (web2py development server), it works ok. 
>> However in production, it keeps always showing message "I just wrote 
>> myvariable".. It seems as it couldn't write/store session variables.
>> I'm using last stable version of web2py (2.4.6) in development and in 
>> production. same version.
>> For production I'm using lighttpd running under www-data user.
>> In production server "session" folder belongs to www-data and I tried 
>> setting 777 permissions but nothing changed.
>>
>> ¿Would you suggest me some test I can do to debug this? Thanks in advance.
>>
>

-- 

--- 
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