You should open your web browser Developer console and see the real script which reaches the browser.
The Razor parts, @Session["mission"].ToString() doesn't exists in the browser script, because they are evaluated in the server, before sending them to the browser. So it makes no sense to try @Session["mission"].ToString() != "1" this in the console. In the browser you will get something like:
if (1 != "1")
or even like
if ( != "1")
which would provoke an error.
JavaScript does coalescing, so 1 is equal to "1" when you use the comparers == or !=, so you don't need to include the qoutes around the value (unless you get the error mentioned above: in this case, if you included the quotes, you'd get if ("" != "1")).
Coalescing is avoided by using the !== or === which would consider 1 not equal to "1", so, including the quotes doesn't make any difference in this case.
@Session["mission"].ToString()? Did you meantoString?@Session["mission"].ToString().@Session["mission"].ToString()to make sure it is what you expect@Session["mission"]before theif elsestatement, just to ensure that it is not null