Page 1 of 1

WAM SessionStatus not working for me

Posted: Thu Feb 23, 2017 1:45 am
by HMJust
I have a site built with WAM using sessions for logins. One WAM (LOGIN) is used for login and logout, like this:

Code: Select all

Webroutine Name(StartPage) Onentry(*sessionstatus_none)
Web_Map For(*BOTH) Fields(#WAWUSR #wawpwd)
...
Endroutine

* validate login - no interface for this routine
Webroutine Name(ValidateLogin) Onentry(*sessionstatus_none)
Web_Map For(*both) Fields(#WAWUSR #wawpwd)
... if login is succesful
#com_self.sessionStatus := Active
Transfer Toroutine(#FIRSTPAGE.INITIALIZE)
... else something else
Endroutine

Webroutine Name(logoff)
#secure #BUTNR #WAWUSR #WAWPWD := *null
#com_self.SessionStatus := Invalid
Transfer Toroutine(#LOGIN.startpage)
Endroutine
Another WAM (MENU) is like this:

Code: Select all

Evtroutine Handling(#com_owner.sessioninvalid) Options(*noclearmessages *noclearerrors)
Transfer Toroutine(#LOGIN.startpage)
Endroutine
Now, my problem is that I can be on the MENU WAM, click on a link to LOGIN.logoff. This executes and there is a transfer to the LOGIN.startpage webroutine. Then I press back in my browser and is returned to the MENU WAM but now I am logged in again.

I believe I have done as described in http://docs.lansa.com/14/en/LANSA087/Co ... b1_360.htm

Can anyone spot my mistake?

Re: WAM SessionStatus not working for me

Posted: Thu Feb 23, 2017 7:18 pm
by HMJust
First mistake is obviously that I thought the WAM session was invalidated on the server when I set

Code: Select all

SessionStatus := Invalid
. It isn't so a new request with the old session key can access the old WAM session.