I think you should use xhr(Ajax) to store your data into php session. Following is a simple example to do this
jQuery.ajax({
url: 'storesession.php',
type: 'POST',
data: {
txt: txt,
},
dataType : 'json',
success: function(data, textStatus, xhr) {
console.log(data); // do with data e.g success message
},
error: function(xhr, textStatus, errorThrown) {
console.log(textStatus.reponseText);
}
});
storesession.php
$_SESSION['value1'] = $_POST['txt'];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…