Wrap your Razor code in @{ } when inside JS script and be aware of using just @
Sometimes it doesn't work:
function hideSurveyReminder() {
@Session["_isSurveyPassed"] = true;
}
This will produce
function hideSurveyReminder() {
False = true;
}
in browser =(