Skip to Content
Jul 08, 2014 at 07:40 AM

Webdynpro logout button - clear session


Hi ,

I know this has been asked multiple times, i found many thread on it but none solved my problem.

I need a logout button which cleans up user's session in my application, so that when the user logs in next time, the user is forced to enter the credentials again(login screen).

Current state of applicaiton:

  • I have created an exit plug , which is triggered when clicking a href button in my application. This works fine as it comes out of the applicaiton into a blank screen.

  • In the applicaiton node(SICF), i have included the java script code.

<html><body><script language="javascript"> function DelSso2Cookie(sName,sPath) {var sso2Domain = location.hostname;if (location.hostname.indexOf(".")>

0)sso2Domain =location.hostname.substr(location.hostname.indexOf(".")+ 1);p="";if(sPath)p=" path="+sPath+";";document.cookie = sName+"=0; expires=Fri, 31 Dec 1999 23:59:59GMT;"+p + "domain="+sso2Domain+";";}

</script><span style="font-weight:bold;vertical-align:middle"> <br>

You are logged off successfully


<script language="javascript">

try {document.execCommand( 'ClearAuthenticationCache' );} catch (e) {} DelSso2Cookie("MYSAPSSO2","/");

<body onload = "DelSso2Cookie("MYSAPSSO2","/")">

The application logs in automatically when i relaunch the application (user not prompted with login screen).

Thanks & regards,