If you just want to post a variable to a DB you don't have to use a session.
$first = $_POST['firstname'];
$last = $_POST['lastname'];
$var = "you variable";
$con = mysql_connect("localhost","user","pass");
die('Could not connect: ' . mysql_error());
mysql_query("INSERT INTO table (first, last, var)
VALUES ('$first', '$last','$var')");
Obviously this needs to be cleaned up, and needs a few improvements. But it shows you don't need a session for simply posting a variable.