Wednesday, April 16, 2008

OAM ObSSOCookie Logoff JavaScript Code

You may use the following code to Delete ObSSOCookie (or any other) cookie to logoff from OAM.

<script type="text/javascript">
// this deletes the cookie when called

function LogoffOAM(){
Logoff('ObSSOCookie', '/', '');
}

function Logoff( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";

javascript:Confirm();

}
function Get_Cookie( name ) {

var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}


function closeWindow(win) {


win.open('','_parent','');

win.close();


}


function Confirm ()
{

window.location = "http://www.bhatiacorp.com";

}

function logoffRedirect ()
{
alert(" You are logged off.\n\n You will be redirected to Corporate Web Site.");
window.location = "http://www.bhatiacorp.com";
}



</script>

No comments: