Ajax and php sessions
Ajax and php sessions
Hallo all, I'm facing some trouble when trying to load one php page with jquery's load() method.
Not sure how load() works, but I assume it uses ajax.
The problem is, that in page page1.php (for example), I set a value in the session:
if(!isset($_SESSION['step']) || $_SESSION['step']==""){
$_SESSION['step'] = "step1";
include("steps/step1.php");
}
<script type="text/javascript">
$('#container').load('steps/step2.php');
</script>
Now in page step2.php I change $_SESSION['step'] = "step2";
But it seems that the session doesn't change to "step2", when the page step2.php is loaded.
Hope you can understand what I mean.
Is the logic above incorect? Or if not is there a way to use jquery (or ajax) to change the values in sessions?
Thanks alot!!