Setting session variable

I like to set a session variable.

The following code is one of trials for it. but it doesn’t work as I expected.

<?php
set session name=mySession value=1;
?>

How can I set a session variable correctly?

I doubt you’re going to get any replies to this because you’ve obviously avoided using your Google Foo.

Okay, I set a session with the code below

<!doctype html>
<html>
   <head>
    <meta charset="UTF-8">
    <title>session1</title>
<body>
<?php
$_SESSION['mySession'] = 11;
echo $_SESSION['mySession']
?> 
</body>
</html>

Did I set a session and output the value correctly with the code above?

as they say in the classics:

“Let :google: be your friend and rtfm (read the fine manual)”

session variables

hint:

session_start()