Session is a server side technology and JavaScript is client side. So JavaScript code knows nothing about the Session. If you need to clear some session value, you will need to post the form to server and tell it to clear that value. The good thing is you can post the form using JavaScript.
You would like to read about -
jQuery.ajax()[
^] to implement this. :thumbsup: