This content has been marked as final. Show 5 replies
You can use the securityStatus of the /atg/userprofiling/Profile componenent.
Check for this property in the jsp. Typically if it is 4 or 5, for normal logged in users (6 for those who uses certificate). You can use Redirect droplet to redirect the other users. However this will not automatically redirect the user on session expiration and needs at least a page refresh.
In the java code, you can check for Profile.isTransient() method which returns true for guest users.
You can refer to the below sections in the ATG Personalization Programming Guide:
4 Working with User Profiles -> Tracking Users -> Security Status
4 Working with User Profiles -> Tracking Users -> Using Security Status in Content Pages
Using SecurityStatus I can identify whether the user is logged in or not. But in our application guest users can also do a checkout process completely. Our requirement is If a guestUser/loggedinUser add some items and stays idle in cart page for 30 min, we have to redirect the user to appropriate session expired page
In cart page I have set the sessionExpirationURL of cartformhandler to appropriate jsp, checkForValidSession to true, CheckSessionExpiration.expirationURL to >same session expired jsp. I am not sure why this is not working.This won't happen automatically. Only when your request makes a call to the formhandler it can check for session and then redirect if required.
You are absolutely correct. In our case also the requirement is same. After session expiration, we should redirect the user to session expired page on any further user actions. For example if he clicks on any link or any button present on cart page after session expiration, we should redirect the user to session expired page.
When user clicks any link on your page after session expired then you can redirect him to login page through your formhandler if a handleX() method was invoked by the request or you can use a filter which can check for something like profile.isTransient(). You can then redirect to the login page from your filter keeping a parameter of the original url to be used as login success url so that after login you can again redirect to the page that user originally intended to see.
Apart from this, you may also want to take a look at reverse ajax to send the timed out kind of notification to the browser with the help of a HttpSessionListener:
Hope this helps.
Edited by: Nitin Khare on Aug 23, 2012 12:15 AM