I can definitely tell this was converted from a vB style language.
PHP is a C based language, the syntax you have isn't correct. Anytime you make a comparison, you must use
in PHP is an assignment operator.
The other thing is the lack of braces. PHP allows non-braced branches, but will only apply for the next processing instruction or contained branch. Use full braces always to prevent confusion or ambiguity especially while reading. Alternatively (though I don't actually recommend this since PHP should reflect a C based language), you may use the alternative syntax
in PHP which will more closely resemble the ASP code (though the comparisons will not be changeable).
Next, variables in PHP are case sensitive: $_SESSION is not the same as $_Session. The array accessing is correct, you should always write associative indexing in strings, though I will suggest to always use single quotations when using a constant string since its faster than double quotations which require parsing; however, $varname($offset) is not actually an array access, it is a variable function (asp may have them called under delegates), which isn't what you want.
Since PHP is datatype weak, you needn't actually check a resulting boolean in a branch if you don't want to.
if ($var == true)
is the same as
, assuming $var is a boolean.
Finally, you must use session_start(), preferably at the start of every PHP page you intend to use sessions on.