PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WB 22] Prevent going back to page after logout
[WB 22] Prevent going back to page after logout
Débuté par Luis Antonio Gutiérrez Flores, 13 oct. 2017 16:17 - 4 réponses
Posté le 13 octobre 2017 - 16:17
Good morning, I'm having some trouble trying to prevent users from going back to the software after logging out, I've tried using some code in the Synchronization of PAGE_ but it does nothing, and I can't use the prevent from using the browser "Back" key to go back to this page because it looks bad and also prevents going back to the page while being logged in. Maybe I'm using wrong the synchronization code, any tips?
Posté le 13 octobre 2017 - 16:38
Hi Luis,

I did that some time ago, so I'm just going to give you some elements I can remember.

First it depends if you are talking about an awp site or classic one.

If in a classic one, when you can use a loop on all the pages names (with an enumxxxx) to test the context (contextexist) and close it if open (context close)

Then in all cases, in the page onload browser code, you should test with an ajaxecute if your session is valid (what is a valid session is up to you, used logged in or not, time out, etc), if not, then restart your site with a dynamicsitedisplay or pagedisplay, depending on the type of site.

Best regards
Posté le 13 octobre 2017 - 16:56
Thanks Fabrice! My page is not awp, I'm going to try this, just another question. Where do I put the code for the enum? Is it in the onload browser event too?
Posté le 13 octobre 2017 - 18:04
Hi again

you need to do the enum and the context closing in the code that is closing your web site (log off, or init of the new login page, if you are going back to that)

anyway, that part is in serve code, to make sure that anything that they MAY access from the browser history will NOT function on the server side.

The browser code is to attemps to prevent them to SEE any page, the server side to make sure that if the browser side is not enough, they will at least not be able to go any further than a snapshot of an old page

Best regards
Posté le 13 octobre 2017 - 19:41
Got it working Fabrice! Thanks for your help! :D