In Setup >> Administer >> Security Controls >> Session Settings >> System Admin can define Logout Page URL. Can we get this url through Apex code.

1 Answer 1


Using the SessionManagement Class you have a method getCurrentSession() that return a map that includes the LogoutURL.


Returns a map of attributes for the current session.


public static Map<String, String> getCurrentSession()

Return Value

Type: Map<String, String>


The map includes a ParentId value, which is the 18-character ID for the parent session, if one exists (for example, if the current session is for a canvas app). If the current session doesn’t have a parent, this value is null. The map also includes the LogoutUrl assigned to the current session.

  • If mentioned method retrieves logout url, please add it to answer.
    – Raul
    Commented Feb 7, 2017 at 7:41
  • If you check the details, the map also includes LogoutUrl
    – RCS
    Commented Feb 7, 2017 at 8:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .