Session is not getting maintain in settings.php drupal 7
You can't start session_start() the second time, since Drupal is already started it.

So either remove it, or wrap it into the condition, e.g.:

if (session_status() == PHP_SESSION_NONE) {
    session_start();
}


Parsing input user variables is not a good idea, so it's better if filter it out, e.g.

$_SESSION['data'] = filter_input(INPUT_POST, 'year', FILTER_SANITIZE_STRING);


or better use db_escape_table().