How log out a user without Salesforce user menu

  • 2
  • Question
  • Updated 3 years ago
  • Answered
Wondering If we can write any script to log out a user. All we want just have a button (not the navigation menu) that would cause the user log out and redirect to the log in page.
Photo of Tanzir Riad

Tanzir Riad

  • 414 Points 250 badge 2x thumb

Posted 3 years ago

  • 2
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Try a button that redirects the user to:
https://na22.salesforce.com/secur/log...
It can be a button in a Page title or a navigation item or you can build your own button in a template
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Agreed, a simple "Redirect to URL" action with the following relative URL (so it works regardless of the instance you're on) should do the trick:

/secur/logout.jsp
Photo of Tanzir Riad

Tanzir Riad

  • 414 Points 250 badge 2x thumb
Thanks Raymond and Zach. That was exactly what we needed.