To use session in JavaScript, write
var variableName='<%= Session("Value").ToString() %>' Here the below code, which you can use as a session in JavaScript under <head> tag, but you can't use this in external JavaScript(.js) files.
<script type="text/javascript" language="javascript">
window.onload = function()
{
var sampleColor = '<%=Session["Color"]%>';
alert(sampleColor);
}
</script>