var x = e.pageX;
var y = e.pageY;
Which is the easiest way to save those jQuery variables in a PHP session.
$.ajax({
url: '/update-session.php',
data: {"x":e.pageX,"y":e.pageY},
type: 'post',
success:function(data){
// if you care.
}
});
update-session.php:
$_SESSION['pageX'] = $_POST['x'];
$_SESSION['pageY'] = $_POST['y'];
Make an AJAX request to a PHP page that saves them in the session.