function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

logout issue


We have implemented logout functioanlity by adding script "/secur/logout.jsp" to visualforce page for sites. But whenever we logout, it is going to Sales force logout page and then going to login page. As per requirement we dont want to show sales force logout page. please let me is there any java script or other scipt to change the behavior.



Ravikumar Katragunta

Ankit AroraAnkit Arora

I guess you are challenging native behavior of salesforce.



Ankit Arora



Hi Ravi,


All you have to do is, use "your required url" instead of "/secur/logout.jsp" in your visualforce page in your logout paramater. Let me know if this is what you are looking for?



Shashikant SharmaShashikant Sharma

Go to partner settings and set logout url there.


I had the same problem but wasn't worried about it too much.  I couldn't find anything settings within SFDC that would prevent that intermittent page so I wrote some javascript to do it.  It's a little clunky, but it will solve your immediate problem.


Replace the logout link you are using now with the a href tag.  When a user clicks logout, a window will popup real quick then disappear and then they will be redirected to whatever URL you set in the location.href.


I think a hidden iframe on another page would probably be better than the pop-up but this does work.


<script type="text/javascript">
function logout()
    popup ="{!$Site.Prefix}/secur/logout.jsp", "popup", "status=1,width=0,height=0");
    <a href="" onclick="return logout()">Logout</a>



Steve Wasula


Found a better solution...


  1. Create a new VF page called logout
  2. Change the logout link to point to the new page with the following code

<apex:page showheader="false">
<meta http-equiv="Refresh" content="1, URL=" />
<iframe src="{!$Site.Prefix}/secur/logout.jsp" width="100%" height="0"></iframe>
Logging Out ....


The logout page will display for 1 second and then redirect the logged out user to whatever page you want.  It also doesn't require javascript.


Hope this helps,



Rajkumar VenkatRajkumar Venkat

its solves the issue.. thanks

Satyendra RawatSatyendra Rawat
            <meta http-equiv="Refresh" content="1, URL=" /> 
           Above line is not working in Internet Explorer, Below Line is the FIX for all browsers :
<meta http-equiv="refresh" content="0;URL=" />


Meenu AroraMeenu Arora
This page is redirecting to logout1 page only. 

please let me know where and how i can override the /secur/logout.jsp. As far as I know, we dont have default site.logout() method provided by salesforce. 

I am trying to override the logout functionality for standard salesforce and not for any curstomer portal. Please assist urgently.