Salve, io ho una domanda che per voi é semplice.
Come faccio a dare un nome a una sessione e stampare il nome della sessione?
io uso firefox e quando faccio strumenti->opzioni->mostra i cookie come nome vedo PHPSESSID.
io vorrei vedere il nome dell'utente come nome.
Quello che segue é il mio script.
------------------------------------------------------------------------------
<?php
session_start();
include 'config.inc.php';
if (isset($_POST["invio"])) {
$username = $_POST['username'];
$password = $_POST['password'];
$password_md5 = md5($password);
$sql = "select username,password from utenti where username = '$username' and password='$password_md5'";
$sql = mysql_query($sql,$db_connection) or die ("ERROR");
if(mysql_num_rows($sql)==0) {
$destinazione = "destroy.php";
}
else
{
session_register('autorizzato');
$_SESSION["autorizzato"] = 1;
$destinazione = "inizia.php";
}
echo '<script language=javascript>document.location.href="'.$des tinazione.'"</script>';
} else { ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Prova Login php</title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<form method="post" action="login.php">
<table width="300" cellpadding="4" cellspacing="1" border="0">
<tr>
<td colspan="2" align="left">
<u>inserite nome utente e password</u>:
</td>
</tr>
<tr>
<td>
nome utente:
</td>
<td>
<input type="text" name="username">
</td>
</tr>
<tr>
<td>
password:
</td>
<td>
<input type="password" name="password">
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="invio" value="invio">
<input type="reset" name="cancella" value="cancella">
</td>
</tr>
</table>
</form>
</body>
</html>
<?
}
?>
------------------------------------------------------------------------------
Grazie a tutti