You need to enclose your if statement block as shown below:
if($_POST['submit']) {
    $hour = time() + 3600;
    setcookie('username', $_POST['username'], $hour,'/');
    setcookie('password', $_POST['pass'], $hour,'/');
    header("Location: tutorhomepage.php");
}
Also, you need to move connection etc. part just after the above segment.
<?php
if($_POST['submit']){
    $hour = time() + 3600;
    setcookie('username', $_POST['username'], $hour,'/');
    setcookie('password', $_POST['pass'], $hour,'/');
    header("Location: tutorhomepage.php");
}
//------ server and mysql connection
$connection = mysql_connect('mywebsite', 'username', 'password') or die('Unable to connect');
mysql_select_db('myDB') or die('unbable to select DB');
//------log in cookie check
if (isset($_COOKIE['username'])) {
    $username = $_COOKIE['username'];
    $pass = $_COOKIE['password'];
    $check = mysql_query("SELECT * FROM tutors WHERE username = '$username'") or die(mysql_error());
    while ($info = mysql_fetch_row($check)) {
        if ($pass != $info[1]) {    
        } else {
            header("Location: /tutorhomepage.php");
        }
    }
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Login</title>
    </head>    
    <body><?php
//------- if form is submitted
if (isset($_POST['submit'])) {
    // check if the user enetered login details
    if (!$_POST['username'] | !$_POST['pass']) {
        die('You must enter the required data.');
    }
// and so on