In oracle ATG, how can we prevent a user who is already logged into the site from login again. In my application if the user is logged in and if he comes back to login page and try to login again it is showing invalid session. Can we disable this in atg?
Asked
Active
Viewed 1,077 times
1
-
Can you clarify: Is the problem that the users are able to access the login page? Or are you asking how you prevent users from logging in again once they are logged in? – bated Aug 05 '15 at 14:59
-
Is the login page itself rendered by your ATG app? – zmcmahon Aug 05 '15 at 18:48
-
Yes I need to prevent user from execute handleLogin method again if the user is logged in. How I had done is checking whether the profile is transient inside handle login I want to understand whether we have any default atg implementation for this like RepeatRequestMonitor. – David Aug 06 '15 at 10:28
-
The RepeatingRequestMonitor is to prevent a user from submitting the same form multiple times e.g. a user who clicks login twice in rapid succession. – bated Aug 06 '15 at 17:03
-
You can override `preLoginUser` method and return appropriate message if user is Transient. – Saurabh Sep 08 '15 at 07:47
1 Answers
1
There are a number of ways to achieve what you want:
- You could include logic on the jsp which contains the login form fragment to include different fragements based on whether the user is logged in or not e.g. if the user is logged in include a fragment which says "You are already logged in or similar"
You could use the
Redirectdroplet e.g.<dsp:importbean bean="/atg/dynamo/droplet/Switch"/> <dsp:droplet name="Switch"> <dsp:param name="value" param="Profile.isTransient"/> <dsp:oparam name="false"> <!-- redirect to another page --> <dsp:droplet name="/atg/dynamo/droplet/Redirect"> <dsp:param name="url" value="http://www.acme.com/alreadyLoggedIn.jsp"/> </dsp:droplet> </dsp:oparam> <dsp:oparam name="true"> <!-- do nothing --> </dsp:oparam> </dsp:droplet>`
bated
- 960
- 2
- 15
- 29