salve ho realizzato sistema di registrazione e log-in...per il secondo ho 2 pag:

1 - accedi.php

Codice PHP:
<form action="log_in.php" method="POST" >
<
fieldset>


 <
label for="username">Username:</label>
 <
input type="text" name="username" id="username" /> 
</
p


 <
label for="password">Password:</label>
<
input type="password" name="password" id="password" />
</
p>
 <
input type="submit" name="button" id="button" value="log in" />
</
fieldset>
</
form
2 - log_in.php

Codice PHP:
ini_set('session.entropy_file''/dev/urandom/');  //le ini_set sono al posto giusto?
ini_set('session.entropy_lenght''512');
ini_set('session.hash_function''256');
ini_set('session.hash_bits_per_character''6');
ini_set('session.cookie_secure'0);
ini_set('session.cookie_httponly'1);
ini_set('session.use_only_cookies'1);
session_start();
if (empty(
$_POST) === false) {
             
$username str_replace("\\","",$_POST['username']);
             
$password str_replace("\\","",$_POST['password']);
             if(empty(
$username) === true || empty($password) === true){
               
$errori[] = "inserisci username e password";
            }else if (
user_exists($username) === false){ // se user esiste
               
$errori [] = "username inesistente";
            }else if (
user_active($username) === false){ // se account è attivo
               
$errori [] = "il tuo account non ancora attivo";
            }else if (
preg_match("/\\s/"$_POST['username']) === 1){ //se username ha spazi
               
$errori[] = "username contiene caratteri non ammessi";
            }else if ((
preg_match('/[A-Z]|[!|"|£|)|(|$|%|&|(|)|{|}|=|?|^|€|[|°|.|+|*|<|>|;|,|:|]/'$_POST['username'])) OR (preg_match("/'|ì|é|è|ò|à|ù|#|@|§|]/"$_POST['username']))){
                
$errori[] = "username contiene caratteri non ammessi"
             }else if (
is_numeric(strpos($_POST['username'],"/"))){
                
$errori[] = "username contiene caratteri non ammessi"
             }else if (
preg_match("/\\s/"$_POST['password']) === 1){
                
$errori[] = "password contiene caratteri non ammessi";
             }else if ((
preg_match('/[A-Z]|[!|"|£|)|(|$|%|&|(|)|{|}|=|?|^|€|[|°|.|+|*|<|>|;|,|:|]/'$_POST['password'])) OR (preg_match("/'|ì|é|è|ò|à|ù|#|@|§|]/"$_POST['password']))){
                
$errori[] = "password contiene caratteri non ammessi"
             }else if (
is_numeric(strpos($_POST['password'],"/"))){
                
$errori[] = "password contiene caratteri non ammessi"
             }else{
                 
$login login($username$password); // se esiste user con questi us e ps 
                  
if($login === false){
                  
$errors [] = "impossibile accedere con questi dati";
                  }else{
                     
$id_user user($username$password); //funzione recuper id associato a username&password
                     
$_SESSION['id'] = $id_user;         
                     
session_regenerate_id(true);                       //è al posto giusto?
                     
header ("Location:  //localhost/girolimoni/user_data.php");
                    exit();
                 }
             } 
}else{
    
$errori[] = 'inserisci username e password';

..per contrastare session hijacking e fixation ho usato alcune ini_set e session_regenerate_id... sono usati in modo appropriato?...grazie