Hi,
Basically, in order to show the user message that the session has timed out, you may use Agent Configuration Parameters: IdleTimeoutURL and MaxTimeoutURL. For detail, see the docops.
https://docops.ca.com/ca-single-sign-on/12-8/en/configuring/web-agent-configuration/session-protection/redirect-a-user-after-a-session-time-out
Next, regarding capturing the last accessed url, unfortunately I do not have such code that you are asking. But, please let me show just an idea - you could make use of the “Referer” HTTP header in the HTTP request to such URL as IdleTimeoutURL or MaxTimeoutURL.
I mean: if IdleTimeoutURL is targeted to a JSP (or something else) for example, then it might capture the header and pursue the redirection that you want.
IdleTimeoutURL = ”http://example.mycompany.com/sessionidletimeoutpage.jsp”
I hope this will help.
Regards,
Koichi Ikarashi