cancel
Showing results for 
Search instead for 
Did you mean: 

User closing browser without clicking logoff link in mastheader...

PradeepBondla
Active Contributor
0 Kudos

Hi All,

When EP users clicks on logoff link in the mastheader, we are redirecting the url and in logoff() method I am deleting session/cookies etc.. till this point its fine... working perfectly.

If users clicks on IE close (browser X on upper left corner), its not deleting any cookies... other user opening the portal on same terminal will automatically see previous users portal. how to remove cookies/session when user closes browser without clicking logoff link on mastheader.

I check SDN for this... but everyone talking about logoff url... logoff url working fine for me... when user closes browser with out clicking logoff... that portal session must end.

I referred many sdn posts like

but no solution found...

Once again I will explain my issue... IF USER CLICKS ON LOGOFF URL, ALL PORTAL SESSIONS/COOKIES ARE CLICKED(no issues with logoff link)... BUT IF USER CLICKS ON BROWSER CLOSE ("X" ON UPPER LEFT CORNER) NO PORTAL SESSION/COOKEIS ARE KILLED.

Thanks,

PradeeP

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Pradeep,

The portal logon cookie is a browser session based cookie. So when the user closes the browser (this kills the session) the cookie is deleted. I am surprised that you say another user on the same terminal can then just log on with out any logon screen. What authentication mechanism are you using (basic user id/password, kerberos, etc...)??

It is possible to catch the browser close action in JavaScript (in fact this is how DSM termination works in the portal), but if the user is really closing the browser fully then the logon ticket is deleted anyway and the next user has to use a new browser session and therefore create their own logon ticket (by logging on).

BRgds,

Simon

PradeepBondla
Active Contributor
0 Kudos

Hi Simon,

We are using basic authentication with user id /pwd.... We are using IE 8 thoughout our systems. This is happening when more than one browser is open.

1. If only one IE 8 browser is opened in the system/computer (which is portal) and if I close the browser using browser X button. when User again opens new IE 8 browse and type the protal urlr. It is asking for user ID and PWD. which is fine.

2. If there are multiple IE 8 browsers are opened in the system/computer (can be any IE 8 browser, not neccessary that it should run portal) which was running any other site... when user closes the portal using browser X button and when user again types portal URL it automatically logging in.

What is happening is... IE 8 shares the browser cookies / sessions through out all opened browsers in that system/computer.

If there is only on IE 8 portal browser opened and user closes that... then if open another IE 8 it is asking for user id and pwd.

If multiple browsers opened, portal cookies/sessions shared throughout all the browsers... so when user opens another portal browser after closing existing (by clciking X) its taking cookie/session from other browser and logging in automatically.

If user closes all the browsers, then no problem... its working fine.

Same problem with mulitple tabs in single browser...

how to trigger DSM termination from portal explicitly on browser close????

Thanks,

PradeeP

Former Member
0 Kudos

Hi,

That makes sense now! I suggest you take a look at ways to catch the user closing the browser (e.g. http://blogs.x2line.com/al/articles/756.aspx) A quick google search for "JavaScript catch browser close event" should do the trick. You could also take a look at the code behind any portal page where DSM is active as this does a similar thing to ensure RFC connections from JCO get terminated.

Once you work out how to catch the event, you should be able to use the same code you currently have to remove the cookies.

Hope this helps you,

Simon

PradeepBondla
Active Contributor
0 Kudos

Hi Simon,

I catched browser close action using a javascript code


fun ction winUnload(){
a lert ("Browser cloded");
}
win dow.onun load = func tion(){
winU nload();
}

Inside the code I am trying to call DSM terminator... /irj/servlet/prt/portal/prtroot/com.sap.portal.dsm.Terminator

i also tried calling EP CM.DSM.temi nateAll ()

also tried

EP CM.DS M.init( {

Termin atorURL:"/irj/servlet/prt/portal/prtroot/com.sap.portal.dsm.Terminator",

WinEm ptyUrl:"/irj/portalapps/com.sap.portal.dsm/images/empty.gif",

Forced UserDebug:false,

KeepA liveActive:false,

KeepA liveDelta:840,

KeepAliveStopAfter:36000

} );

None of them worked... is there any other way to call DSM terminator from my code???

Thanks,

PradeeP

Former Member
0 Kudos

Hi,

Don't worry about calling DSM... just run some script or redirect to a page that deletes the MYSAPSSO2 cookie from the browser then let the window close. That should achieve what you are after.

BRgds,

Simon