If I pass the session trough url ... (No cookies)
What I have done is the following:
1- I check pass in database.
2- If password is ok I open session and I stored session_id in database and I also send it to page 3.
3 - If password is wrong back to form.
4 - If they access to 3erd page, I get the session from url and I check with session stored in DB.
I REALLY BELIEVE THERE'S SOMETHING EASIER THAN THIS!
<?
session_register('usuario');
?>
<?
$conn = mysql_connect("bla","bla","bla");
mysql_select_db("bla",$conn);
$ssql = "SELECT * FROM Clientes WHERE Inmo='$Inmo' and Password='$Password'";
$rs = mysql_query($ssql,$conn);
if (mysql_num_rows($rs)!=0){
session_start();
session_register("autentificado");
$autentificado = "SI";
$Sesion=session_id();
$Sesioname=session_name();
$Bothsesiones=$Sesioname."=".$Sesion;
$Fecha = date("Y-d-m h:i:s");
$sql = "INSERT INTO Sesiones ( Fecha, Sesion, Inmo)" .
"VALUES ('$Fecha', '$Sesion', '$Inmo')";
$result = mysql_query($sql) or die(mysql_error().'<p>'.$sql.'</p>');
header ("Location: uploader.html?$Bothsesiones");
}else {
header("Location: acceso2.html?errorusuario=si");
}
mysql_free_result($rs);
mysql_close($conn);
?>