I'm trying to write a mobile web app with JqueryMobile, the mobile will be my client, I also have a php service that will manage login sessions, but the php creates a new session in each ajax calls, I see the generated session files in my session file path, I need to resume the php sessions.
The php file is look like this :
header("Content-type: text/html; charset=utf-8");
header("Access-Control-Allow-Origin: *");
require 'connect_to_db.php';
// Starting the session
session_name('MySessionName');
// Making the cookie live for 2 weeks
session_set_cookie_params(2*7*24*60*60);
session_start();
...
// checking if loged in ...
?>
and the ajax request :
$.ajax({
url: baseUrl + "login.php",
crossDomain: true,
type: "POST",
data:{
command: "Login",
username: $("#username").val(),
password: $("#password").val()
},
dataType: "json",
success: function(response)
{
$.mobile.changePage("#DataList");
},
});
I checked many pages from stackoverflow but no success. I'm testing my app in firefox and xampp.