Session information is usually stored on the server. An HTTP request for a page that destroys a session usually does the trick (using AJAX if you want).
For cookies, you can set the cookie expiration date to the current date, this will expire the cookie and delete it.
var d = new Date();
document.cookie = "cookiename=1;expires=" + d.toGMTString() + ";" + ";";
source
share