[Seaside] Re: logout problem

Sebastián Perez Escribano sebaspe at gmail.com
Mon Oct 27 16:09:20 UTC 2008

Here is some example code:

MySession >> incomingRequest: aRequest

    ^self user
                ifNotNil: [super incomingRequest: aRequest]
                ifNil:  [self webLogOut: aRequest]]

MySessio >> webLogOut: aRequest
    | wttHome |
     wttHome := self parent baseUrl asString.
    ^WAResponse redirectTo: wttHome

WAMyMainPage >> renderContentOn: html
    (html div)
        id: 'leftMenu';
        with: [self renderLeftPanelOn: html].
    (html div)
        id: 'mainComponent';
        with: [self renderMainComponentOn: html].

WAMyLeftMenu >> renderComponent: component label: label on: html
    | updater |
    updater := self updaterOn: html for: component.
    (html div)
        id: label;
        with: [html listItem with:
                            [(html anchor)
                                onClick: updater;
                                with: label]]

WAMyLeftMenu >> updaterOn: html for: component
    "This is the method with problems"

    ^(html updater)
        id: 'mainComponent';
        callback: [:renderer | self showMainComponent: component on: 

Again, the problem is when the user is nil and when I click on an anchor 
in WAMyLeftMenu.

Greatings in advance!

Sebastián Perez Escribano escribió:
> Hi list, I have a site with login. When you login, the site have one 
> component with two divs: a menu div (left) and a center div (right).  
> On the menu div I have anchors, on click (using AJAX) shows a diferent 
> component on the center div. The problem is when the session expire, 
> I`d like to call to the login page. So I override the method: 
> #incomingRequest:. In that method I check and redirect if I need it. 
> It works fine with all components in the center div, but when I click 
> on an anchor in the menu div doesnt. Any ideas?
> Cheers

More information about the seaside mailing list