Am using Angular2 and Php as my server side scripting language. I want to create a session in Php and returned to Angular2 and this session is keep until it expires .
in angular2, I used a function when the login button is pressed
save()
{
var ret = this.http.get('http://localhost/php/login.php?value='+this.Username+'&value2='+this.Password)
.subscribe();
alert(ret); // alerting [Object Object]
}
and in my server side
<?php
$user = $_GET['value'];
$pass=$_GET['value2'];
$result = $user.$pass;
// here i want to create the session and return
// now i simply returns a number
return 1;
?>
what is the best solution for this ..?