Answer the question
In order to leave comments, you need to log in
How to fix session write problem?
From the js file using ajax, a variable is passed to write to the session and this variable is returned from the session:
$.ajax({
type: 'POST',
url: siteTemplate + '/vision/vision.php',
data: {
vision: 'test'
},
success: function(data){
console.log(data);
}
});
session_start();
$_SESSION['vision'] = $_POST['vision'];
echo $_SESSION['vision'];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question