Skip to content

Instantly share code, notes, and snippets.

@metadaddy
Created November 1, 2012 21:05
Show Gist options
  • Select an option

  • Save metadaddy/3996535 to your computer and use it in GitHub Desktop.

Select an option

Save metadaddy/3996535 to your computer and use it in GitHub Desktop.
Logout from Salesforce
<apex:page >
<script>
var win = window.open('https://login.salesforce.com/secur/logout.jsp', '_blank');
setTimeout(function(){ win.close(); }, 2000);
</script>
<h1>Test Open/Close</h1>
</apex:page>
@metadaddy

Copy link
Copy Markdown
Author

In a Visualforce page for easy testing, but should work from anywhere.

@mshanemc

Copy link
Copy Markdown

I needed to do this...wasn't working on jQuery mobile framework.

I switched to an apex:iframe with height and width zero that contains that /logout.jsp page. That worked more elegantly, and avoids the issues with mobile framework naviation or popup blockers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment