When I try to check is $_SESSION['logger'] started I get empty answer. Before when I used only php it worked but now when I tried with juqery it does not.
Let say my code on html is:
<input name="logger" id="logger" />
<input name="submit" id="submit" type="submit" value="Submit">
And jquery code is:
$("#submit").click(function(){
var logger = $("#logger").val();
$.ajax({
type: "POST",
url: "login.php",
data: {logger: logger},
success: function(logg){
window.location.replace(logg);
}
});
});
And php is :
session_start();
if($_POST['logger']!="" && $_POST['logger']!=NULL){
NOW I NEED TO CHECK IS $_POST['logger']==$_SESSION['logger']
}
But it seems I can't get $_SESSION
val because it was never started.. How can I start session with jquery by pressing button.... If you know what I mean. I need this for logged users if $_SESSION['logger']
is set to redirect to his profile from index page..