WAM SessionStatus not working for me

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
User avatar
HMJust
Posts: 53
Joined: Wed May 11, 2016 7:23 pm
Contact:

WAM SessionStatus not working for me

Post 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?
I don't know what I am doing, nor how I did it. If it works, luck was involved :geek:
User avatar
HMJust
Posts: 53
Joined: Wed May 11, 2016 7:23 pm
Contact:

Re: WAM SessionStatus not working for me

Post 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.
I don't know what I am doing, nor how I did it. If it works, luck was involved :geek:
Post Reply