Thank Alvaro for spending time on this, reminding about the problem, and posting this clear summary about the issue.
The way browser behave is very odd indeed. Massimo On May 3, 12:39 am, Álvaro Justen [Turicas] <alvarojus...@gmail.com> wrote: > It is not a bug. > I tried to debug code and more code and then Massimo solved the > "problem": it is not a web2py's bug. > > With <img src="" /> our browsers get login URL twice: one for form > itself and other for the image! Yes, image! With src="" browsers think > img URL is actual URL. So, the login URL is reloaded and cookies and > session vars (like FORMKEY) are changed in second request. But we > submit that form with vars and values of formkey respecting to first > request - that is not valid anymore. Finally, form is not accepted and > I can't see 'Invalid login' message in response.flash. > > Anyway, I don't know if it is in HTML standard (get actual URL when > src=""), but it is not a web2py's bug. > > Thanks, Massimo. > > On Thu, Apr 23, 2009 at 5:37 PM, Álvaro Justen [Turicas] > > > > <alvarojus...@gmail.com> wrote: > > On Thu, Apr 23, 2009 at 4:51 PM, Álvaro Justen [Turicas] > > <alvarojus...@gmail.com> wrote: > >> Hello, > >> I think it is a critical bug. > > >> My site has these views: > >> - template.html - base template system > >> - index.html - extends template.html, only used in main page > >> - pagina.html - extends template.html, used in other pages > >> - padrao.html - extends pagina.html, used in some special pages > >> - pagina2.html - same as pagina.html, but replace {{include}} by > >> {{=BEAUTIFY(response._vars)}} > > >> I'm trying to do auth and if I have in default.py controller: > >> def bla(): > >> response.view = 'padrao.html' > >> return dict(f=auth()) > > >> def blu(): > >> response.view = 'pagina2.html' > >> return dict(f=auth()) > > >> So: > >>http://localhost:8000/myapp/default/bla/loginshows response.flash as > >> None, always > >>http://localhost:8000/myapp/default/blu/loginshows correct response.flash > > >> Both padrao.html and pagina2.html have {{=response.flash}} > > > I'm trying to debug this and isolate the problem. > > I've created a view called 'mytests.html' with: > > > <img id="imggrande" src="" alt="this is a buggy photo" /> > > {{=response.flash}} > > {{=BEAUTIFY(response._vars)}} > > > and: > > > def bluh(): > > response.view = 'mytests.html' > > return dict(conteudo=auth()) > > > So, I don't use extend, include etc. > > With this, response.flash DON'T work. > > If I change mytests.html to: > > > {{=response.flash}} > > {{=BEAUTIFY(response._vars)}} > > > OR to: > > > <img id="imggrande" src="asdadas.jpg" alt="this is a buggy photo" /> > > {{=response.flash}} > > {{=BEAUTIFY(response._vars)}} > > > So, it work! o.O > > > I think there is a regex expecting for something inside src="" from > > img tag. But why this is changing response.flash? > > > I set response.text = 'my text' and bluh() can show this in both cases > > (response.flash working and don't working). > > -- > Álvaro Justen > Peta5 - Telecomunicações e Software Livre > 21 3021-6001 / 9898-0141 > http://www.peta5.com.br/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---