You will need to make a request via ajax for a PHP code, I believe the best solution is js as Diego commented, so via POST it will be possible to store something in the variable $ _SESSION ['value'] in a PHP script .
Here is an example with jQuery:
$("input[name=valor]").keypress(function(){
$.post( "salvaSession.php", { dado: $("input[name=valor]").val() } );
});
That is, every time you press a key in the field, it will send a POST request to salvaSession.php, where salvaSession.php would contain something like:
<?php
session_start(); //se ainda não começou a session.
$_SESSION['valor'] = $_POST['dado'];
?>
This is the basic concept, now you just have to improve it so there are not so many requests, maybe in the lostFocus field.