<?php
session_start();

// Reset then set from request
unset($_SESSION['scheduleMode']);

if (isset($_REQUEST['scheduleMode'])) {
    $mode = strtolower(trim((string)$_REQUEST['scheduleMode']));
    switch ($mode) {
        case 'light':
            $_SESSION['scheduleMode'] = '1';
            break;
        case 'default':
            $_SESSION['scheduleMode'] = '0';
            break;
        // anything else leaves it unset
    }
}
