cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro logout button - clear session

former_member193460
Contributor
0 Kudos


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

<br></span>

<script language="javascript">

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

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

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

Thanks & regards,

Tashi

Accepted Solutions (1)

Accepted Solutions (1)

former_member193460
Contributor
0 Kudos

Solved and Document created for same.

http://scn.sap.com/docs/DOC-56562

Answers (2)

Answers (2)

former_member193460
Contributor
0 Kudos

Hi Experts,

     The application remains logged in if the browser tab is closed, but the instance window is still open.

It works as expected if the user closes the window completely..As required, It will ask the user to enter the credential on relaunch.

I want the user to be prompted with login screen everytime user logs off with the exit plug.

Thanks & Regards,

Tashi

sahai
Contributor
0 Kudos

Hi,

You approach as a wda resource is correct.

Let me know you want to logout from the application or portal? Also you application runs on what kind of environment i.e is it a portal or something else?

Thanks,

Shitanshu Sahai

former_member193460
Contributor
0 Kudos

its a standalone webdynpro applicaiton.

Regards,

Tashi

sahai
Contributor
0 Kudos

Aah...so that is the max you can do, you wont be able to close the IE, that would be possible if your app runs on a portal

former_member193460
Contributor
0 Kudos

i can close the IE, but when i launch the application again.. the user is already logged in.

Regards,

Tashi