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.

Currently I'm using the following to determine whether the session has
timed out or not:

(de getUsr ()
   (db 'uid '+User (cdr (assoc 'uid *Cookies))))

(de usrQuit ()
  (let Usr (getUsr)
     (or Usr (redir "@logout"))))

So the following redirects to logout if the user id is not in a cookie:

(de logout ()
   (setq *Cookies NIL)
   (cookie 'uid NIL)
   (redir "@start"))

The cookie clearing is probably unnecessary come to think about it in
this case, I might as well just redirect to the start function.

Anyway, everything should start with the start function:

(de start () (if (getUsr) (desktop) (signin)))

Which in my case of course redirected to the signin function:

(de signin ()
   (app)
   (action
      (html 0 "RSS Reader" *Css NIL
         (form NIL
            (<table> NIL NIL NIL
               (<row> NIL "Username"  (gui 'uname '(+TextField) 10))
               (<row> NIL "Password"  (gui 'pwd   '(+PwField)   10))
               (<row> NIL
                  (gui '(+Button) "Login"
                     '(let Uid (chkLogin (val> (: home uname)) (val>
(: home pwd)))
                         (if Uid
                            (prog
                               (cookie 'uid Uid)
                               (setq *Cookies (cons 'uid Uid))
                               (redir))
                            (err "Could not login.")))))
               (<row> NIL (<href> "Sign Up" "@register")))))))

It was after pressing the Login button here I got the problem,
redirecting to, and rendering the login form was not a problem.

/Henrik



On Tue, Nov 24, 2009 at 7:41 AM, Alexander Burger <a...@software-lab.de> wrote:
> Hi Henrik,
>
>> registration. After the server has been on for a while I suddenly get
>> http://vizreader.com:39968/366072015751376...@start?*menu=+0&*Tab=+1&*ID=
>> and "Firefox can't establish a connection to the server at
>
> This looks like a timeout. Sessions have by default a timeout of 5
> minutes before a user logs in (and after a user logs out), and 1 hour
> while a user is logged in.
>
> However, as I said, this applies only to sessions, i.e. children of the
> main server process. The server itself does not time out. So I actually
> don't know what causes the problem.
>
>
>> I have no idea where 366072015751376...@start?*menu=+0&*Tab=+1&*ID= is
>> coming from.
>
> This is the standard link URL generated by the GUI. It assumes that a
> menu via <menu> and perhaps tabs via <tab> are present, but does not
> harm if they are not. It has probably nothing to do with the timeout.
>
> Cheers,
> - Alex
> --
> UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
>
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to