You need to sign in to do that
Don't have an account?
Logging out of the Current User in Salesforce Custom Site?
Hi All,
I am trying to Logout current User in Custom Salesforce sites....but i am getting this error:
"java.lang.IllegalArgumentException: Illegal view ID null/Logout. The ID must begin with /"
My Code is :
In VF page
<apex:page action="{!logoutCurrentUser}" controller="SiteLoginController" standardStylesheets="false" title="Login" showHeader="false" sidebar="false">
and Controller:
public PageReference logoutCurrentUser(){
return UserInfo.getUserType() != 'Guest' ? new PageReference(Site.getCurrentSiteUrl() + '/Logout') : null ;
}
Can any one help me out of this?
Thanks in advance :)
Pota,
Change your code from
return UserInfo.getUserType() != 'Guest' ? new PageReference(Site.getCurrentSiteUrl() + '/Logout') : null ;
to
return UserInfo.getUserType() != 'Guest' ? new PageReference( '/secur/logout.jsp') : null ;
Hi Vinit,
Thanks for ur reply..
But...when ever the user clicks directly Logout button..this works fine without any problem.My problem is without clicking Logout button user directly closes the tab and open this site in another tab with same USERNAME and PWD.That time the session is not killed.So..i am getting the following error.
"
Error: Error occurred while loading a Visualforce page.
"
How can i killed out this type of sessions?(through programming)?
Can u pls have a look?
Agreed with you,if a VF session is already there it would not allow you to create a new session as VF session are bound to particular key on post request.
I think there is a perm which can be disabled which would kill the session if you close the browser,but you need to check with salesforce support for that ,not too sure.