Platform
Learn
Community
Support
Partner Center
Sign up
or
Log in
logout
Account Settings
Profile
messages
Messages
logout
Logout
Platform
Home
Downloads
IPP
Licensing
Project Sizing
Learn
Training
Documentation
Evaluation Guide
What's New
Community
Home
Forums
Forge
Ideas
Members
Support
Partner Guide
Resources Library
Opportunities
Account Management
Sign up
or
Log in
Home
Forums
Forge
Ideas
Members
Dear ,
What would improve your OutSystems Community experience? Let us know by taking this 2-minute survey.
Pick up the survey
Community
›
Forums
›
Technology & Integration
Alert when Session Expires
session
authentication
Community
›
Forums
›
Technology & Integration
Alert when Session Expires
session
authentication
New Post
New Post
Nuno Taylor
Posted on 2013-02-22
Nuno Taylor
Rank: #8555
Posted on 2013-02-22
Hi guys,
I'm a little bit new in Outsystems and I'm trying to do something like a redirection and warning when the Session of a user expires by time.
I need to now the best way to detect this expiration and then send the user to a certain screen and then inform the user.
Can anyone explain me how to do this or even a sample oml with this?
Tks in Advance,
N.Taylor
Rúben Gonçalves
Posted on 2013-02-22
Rúben Gonçalves
Rank: #79
Posted on 2013-02-22
Solution
Hi Nuno,
What you're trying to achieve it's not trivial.
First of all, the session timeout, (by default) is by idle time, meaning that it is the time that user its not interacting with the application (no post to the server). And if this is the case that you're tackling, then a simple javascript using a timer should be enough.
If you want, I may try to create an example and post it here.
Cheers,
RG
Solution
Gonçalo Martins
mvp_badge
mvp_label
Posted on 2013-02-22
Gonçalo Martins
mvp_badge
mvp_label
Rank: #49
Posted on 2013-02-22
Solution
Hi Nuno,
You can do that using the Security Handler and redirect the user, for example, to the login page and then show a message if Session.UserId = null.
In this case you should this when the user try to do some action in the current screen.
Kind Regards,
Gonçalo Martins
Solution
Rúben Gonçalves
Posted on 2013-02-22
Rúben Gonçalves
Rank: #79
Posted on 2013-02-22
Solution
Gonçalo Martins
wrote:
Hi Nuno,
You can do that using the Security Handler and redirect the user, for example, to the login page and then show a message if Session.UserId = null.
In this case you should this when the user try to do some action in the current screen.
Kind Regards,
Gonçalo Martins
Hi Gonçalo,
Your solution its the correct one, since it uses the full potencial of the Agile Platform. However, the user is only going to see that message/exception when it click on something or tries to do something, not sure if that is the case.
Cheers,
RG
Solution
Nuno Taylor
Posted on 2013-02-22
Nuno Taylor
Rank: #8555
Posted on 2013-02-22
Solution
Hi Rúben and Goncalo,
Thank for your tips..But since I'm not very proficient with the platform, could you show me a small example (maybe 2screens and the logic for both cases - javascript and Outsystems).
Sorry about it but it would be very important to my learningof Outsystems.
Solution
Rúben Gonçalves
Posted on 2013-02-22
Rúben Gonçalves
Rank: #79
Posted on 2013-02-22
Solution
Nuno,
Before doing it, can you tell us, exactly the behaviour that you're looking for?
Solution
Nuno Taylor
Posted on 2013-02-22
Nuno Taylor
Rank: #8555
Posted on 2013-02-22
Solution
Hi Ruben,
Thank you first of all.
Basically my requirement is to inform a user when his session expires, to enable him to understand the reason and redirect him to the login page (where the message or feedback could be shown if that happens).
If you could show me the Outsystems solution for this in the oml it would be great.
Solution
Rúben Gonçalves
Posted on 2013-02-22
Rúben Gonçalves
Rank: #79
Posted on 2013-02-22
Solution
AppExample.oml
Nuno,
The change is pretty straighforward:
However in attachment you may find the eSpace.
Let me know if it helps.
Solution
Gonçalo Martins
mvp_badge
mvp_label
Posted on 2013-02-22
Gonçalo Martins
mvp_badge
mvp_label
Rank: #49
Posted on 2013-02-22
Solution
That's it Rúben..
Simple as that..:)
- Nuno:
Any additional doubt just say it and good luck with the Agile Platform.
Kind Regards,
Gonçalo Martins
Solution
Nuno Taylor
Posted on 2013-02-22
Nuno Taylor
Rank: #8555
Posted on 2013-02-22
Solution
Thanks a lot guys..
However, I think I'll need a more visual and intuitive way..
If for example we are in a certain screen and the session expires, the user should be informed instantly with a message and after that redirect to the login.
When he enter his credencials he should return to the page from where he came..
I think that Ruben mentioned this case using javascript..but I don't know how.. :s
Solution
Nuno Taylor
Posted on 2013-02-23
Nuno Taylor
Rank: #8555
Posted on 2013-02-23
Solution
Anyone could help me with this??
My skills aren't still enought to implement a solution for it...
Thanks in advance..
Solution
Joop Stringer
Posted on 2013-02-24
Joop Stringer
Rank: #105
Posted on 2013-02-24
Solution
Nuno,
Have you gone through the tutorials ?
A lot of it is explained there ... otherwise look for a short training on the platform, like going to a developers bootcamp
Solution
Rúben Gonçalves
Posted on 2013-02-24
Rúben Gonçalves
Rank: #79
Posted on 2013-02-24
Solution
Nuno Taylor
wrote:
Thanks a lot guys..
However, I think I'll need a more visual and intuitive way..
If for example we are in a certain screen and the session expires, the user should be informed instantly with a message and after that redirect to the login.
When he enter his credencials he should return to the page from where he came..
I think that Ruben mentioned this case using javascript..but I don't know how.. :s
Hi Nuno,
The eSpace that I sent you, does exacly that (shows a message once the user arrives to the login page).
Additionally, I agree Joop, take some time, and do at least the tutorials, they
will help you
to
ramp up
.
Cheers,
RG
Solution
Nuno Taylor
Posted on 2013-02-25
Nuno Taylor
Rank: #8555
Posted on 2013-02-25
Solution
Hi Ruben and Joop,
Thanks a lot for the advices and I already started to see the tutorials.
However, my doubt is very specific and urgent for this issue in the project I'm working.
Ruben spoke about using javascript and the idle timeof the session (I don't know the value of that time) and I would like to know how that is done, since the redirect part I already understood.
Can anyone give me an example oml where we do that automatically when in a screen?
Thank yout very much
Solution
Rúben Gonçalves
Posted on 2013-02-26
Rúben Gonçalves
Rank: #79
Posted on 2013-02-26
Solution
Hi Nuno,
You want to show a message
before
redirecting the user to the login page?
First of all, the session timeout is defined at as explained in this
post
in the machine.config file, with that, you just need to do a
JS timer
that you'll add to all pages and that you'll need to restart each time the user either goes to a page or does an ajax request. This will make your application both harder to maintain and to understand.
Hope it helps.
Solution
Justin James
mvp_badge
mvp_label
Posted on 2013-02-27
Justin James
mvp_badge
mvp_label
Rank: #4
Posted on 2013-02-27
Solution
Nuno -
Are you sure that this is your real requirement? If you use "Remember Password" then they won't need to re-login.
J.Ja
Solution
Gonçalo Martins
mvp_badge
mvp_label
Posted on 2013-02-27
Gonçalo Martins
mvp_badge
mvp_label
Rank: #49
Posted on 2013-02-27
Solution
Nuno,
I agree with Justin, since that is an usual feature.
Check with your client this issue, but also keep in mind the security problems that can arrive with both cases.
Regards,
Gonçalo Martins
Solution
Justin James
mvp_badge
mvp_label
Posted on 2013-02-27
Justin James
mvp_badge
mvp_label
Rank: #4
Posted on 2013-02-27
Solution
Nuno -
One problem you will run into, is that any request back to the server to check status will reset the session timer if they occur before the session expires. So what you need to do is actually have the JavaScript check a bit after the session should expire. Probably the easiest thing to do is use SetInterval to click a hidden button (use style="display: none;", setting "Visible" = False will cause it to not be sent to the screen at all), and that button will call an action. That action will verify that the Session.UserId = NullIdentifer(), then put a message on the screen about the redirect. You can either use AddMetaTag to pass a redirect header to send them to login after a few seconds (do NOT hardcode the URL, use "GetEntryURL" and make an entry to the login page), or better yet, click another hidden on-screen button or link to send you back to login.
J.Ja
Solution
Quick Reply
attachment
Choose File
No file chosen
Submit
Login to reply
New Post
Available Forums
Technology & Integration
News and Announcements
Forge Discussions
Meta
Community Quick Guides
Usability
Installation Troubleshooting
Personal Environment Troubleshooting
Forum Notifications
Email Digest Settings
Loading...