I had to remove the zero completely. It messed up the main application
so I'll try the patch instead.


On Thu, Nov 26, 2009 at 10:44 PM, Henrik Sarvell <hsarv...@gmail.com> wrote=
:
> To recap, it worked fine when I used (url) instead of (redirect).
> However the generated URL incur two problems:
>
> 1.) It looks horrible.
> 2.) Subsequent AJAX calls are using a relative path and I don't want
> to hardcode absolute paths in the JS, hence they won't work and the
> application fails since it relies on them.
>
> I was forgot to save the IRC buffer today so I didn't catch the patch
> but I remembered the zeroing out of Http1, anyway I tried simply doing
> this is in the entrypoint:
>
> (de start ()
> =A0 (off *JS)
> =A0 (zero *Http1)
> =A0 (if (getUsr) (desktop) (signin)))
>
> Note the (zero *Http1). That approach seems to be working, I can
> submit without any problems but I don't know if it will hold up,
> tomorrow will tell.
>
> One very strange thing though, the HTML output looks like this when
> the form first loads:
>
> *start*
> 408
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> <html xmlns=3D"http://www.w3.org/1999/xhtml"; xml:lang=3D"en" lang=3D"en">
> ...
> </html>
>
> 0
> *end*
>
> Note the initial 408 and the final 0.
>
> Check it out live here: http://vizreader.com/ at the moment I'm
> getting 438 instead of 408.
>
> /Henrik
>
>
>
> On Tue, Nov 24, 2009 at 8:55 PM, Henrik Sarvell <hsarv...@gmail.com> wrot=
e:
>> This is odd, the problem seems to be happening when I switch machines,
>> I logged out and in several times at work today to try and trigger the
>> problem. When I came home I still had the cookie so everything worked
>> ok, I logged out, looks like this now:
>>
>> (de logout ()
>> =A0 (setq *Cookies NIL)
>> =A0 (cookie 'uid NIL)
>> =A0 (signin))
>>
>> No redirects anymore, and when I tried to log back in I got exactly
>> the same problem, despite removing the redirect and having (start)
>> look like this:
>>
>> (de start () (off *JS) (if (getUsr) (desktop) (signin)))
>>
>> So no JS either. If you're out of ideas I'll try to reproduce the
>> problem with a simple app that you can easily run.
>>
>> /Henrik
>>
>>
>> On Tue, Nov 24, 2009 at 10:57 AM, Henrik Sarvell <hsarv...@gmail.com> wr=
ote:
>>> Yes (redir) is just a shortcut to:
>>>
>>> (de redir (Func)
>>> =A0 (redirect (pack *Domain (or Func "@desktop"))))
>>>
>>>>>redirecting causes you to lose part of the session's context<<
>>> Good to know.
>>>
>>> I'm sorry, it seems like I missed to list (start) earlier:
>>>
>>> (de start () (if (getUsr) (desktop) (signin)))
>>>
>>> This is the entry point, it will try and get a user object with the
>>> help of the user id in the cookie, if it can't it will simply call
>>> signin which when submitted routes to the dead end (sometimes).
>>>
>>> In fact (usrQuit) and (logout) actually doesn't have anything to do
>>> with the problem at hand since they are not called at all. I'm sorry
>>> that I've been unnecessarily confusing.
>>>
>>> I suppose we're back to the beginning here if manipulating *SesId
>>> won't help me and since I'm not doing unnecessary redirects in this
>>> case?
>>>
>>> Obviously the form is rendered correctly and when I submit the
>>> following should be executed since I'm pretty sure I enter the right
>>> password:
>>>
>>> (prog
>>> =A0(cookie 'uid Uid)
>>> =A0(setq *Cookies (cons 'uid Uid))
>>> =A0(redir))
>>>
>>> And (redir) should render the desktop. However somehow something else
>>> cuts in between, but only sometimes when the server has been running
>>> for some time, never when I just restarted it.
>>>
>>> Could this thing that captures the button click before I have time to
>>> redirect be something in the new JavaScript stuff you've been doing
>>> lately?
>>>
>>>
>>>
>>>
>>> On Tue, Nov 24, 2009 at 10:01 AM, Alexander Burger <a...@software-lab.de=
> wrote:
>>>> On Tue, Nov 24, 2009 at 09:27:16AM +0100, Henrik Sarvell wrote:
>>>>> I think I understand, how would I properly log someone out of the
>>>>> normal GUI, ie when using (app) et al, setting *SesId to NIL maybe? I
>>>>> just browsed http.l and noticed that variable.
>>>>
>>>> I would not manipulate '*SesId'. This would just give errors due to
>>>> illegal accesses to the session.
>>>>
>>>> I use "lib/adm.l", which has functions for login and logout. I'm not
>>>> sure in your case, but for terminating a session just (bye) might also
>>>> suffice.
>>>>
>>>>
>>>>> (de usrQuit ()
>>>>> =A0 (let Usr (getUsr)
>>>>> =A0 =A0 =A0(or Usr (redir "@logout"))))
>>>>
>>>> What does 'redir' do? Something like 'redirect' in "lib/http.l"? Then =
it
>>>> would be better to call (logout) directly instead of redirecting to
>>>> "@logout", wouldn't it? Also, this would avoid an additional HTTP
>>>> transaction.
>>>>
>>>>
>>>>> So the following redirects to logout if the user id is not in a cooki=
e:
>>>>>
>>>>> (de logout ()
>>>>> =A0 =A0(setq *Cookies NIL)
>>>>> =A0 =A0(cookie 'uid NIL)
>>>>> =A0 =A0(redir "@start"))
>>>>
>>>> Same here. I would directly call 'start' or any other functions needed=

Reply via email to