+ Start a Discussion
hari azmeera 8hari azmeera 8 

custom logout functionality in vf page

You cannot do anything after log out .You can write a method and perform all logic and finally return to logout call. 

public pagereference logout(){
       //perform Business logic here
        PageReference pageRef = new PageReference('/default/secur/logout.jsp');
        return pageRef;

Source: salesforce apex callback function onclick of logout in force.com site (http://salesforce.stackexchange.com/q/60990/18731)

check this as well: apex method for logout from force.com site (http://salesforce.stackexchange.com/questions/9499/apex-method-for-logout-from-force-com-site)
One more way to handle in VF page it self
<apex:page >
        var win = window.open('https://login.salesforce.com/secur/logout.jsp', '_blank');
        setTimeout(function(){ win.close(); }, 2000);
    <h1>Test Open/Close</h1>

window.open('https://login.salesforce.com/secur/logout.jsp', '_blank')

on click of any button.. It will redirect to logout page..