Im trying to set a session variable using AJAX but it doesnt seem to work:
This is my PHTML page:
<?php
session_start();
?>
//SOME CODE
<script type="text/javascript">
$j(document).ready(function()
{
var variablecalle=$j("#listadetiendas").val();
var data = 'calle='+variablecalle;
$j.ajax({
url: '../../updatesession.php',
type: 'POST',
data: data
})
});
Then this is my "updatesession.php" page:
<?php
session_start();
$_SESSION['calle']=$_POST['calle'];
?>