OnBeginWebRequest be aware

OnBeginWebRequest be aware

  
Hi all,

Persuant to the post:http://www.outsystems.com/forums/discussion/11168/onsessionstart-be-aware/
I'm having a different behaviour in the OnBeginWebRequest event.

Everything I wrote in the OsSessionStart post can be applied here, but instead of actions, this event is executed when I call a Public screen shared by a producer espace. BUT, if I call the system function getEntryEspaceName() it returns the Producer's name. If I call the same function in the OnSessionStart event, it returns the Consumer's name.

For me this is inconsistent behaviour and is causing me a lot of problems, because I was using the OnBeginWebRequest to validate if the user had permissions to enter that particular app and I assumed (again) the consumer espace would be returned by that function, just as in the OsSessionStart.
Hi Gonçalo,

Actually the result of GetEntryEspaceName is always consistent and like the help says it "returns the name of the eSpace that is processing the current Web request".

It will always return the name of the eSpace that is on the url of the request. So your "producer" screen will be something like http://server/ProducerName/PublicScreen.aspx , and the action will return "ProducerName". If a user has no session or the session is initialized on that page, inside OnSessionStart it will also be "ProducerName".

That said, if all your issues is because of having 2 user provider eSpaces with shared dependencies, I would use the Session.TenantId instead to determine if you need to do the security checks or not.

(I hope your "ProducerEspace" is not the one with the self user provider, because that would mean 2 different sessions between your producer and consumer)

Regards,
João Rosado