I am studying the "session" in php from PHP Power Programming.I got into doubt in the following thing.
There ia a script like
Code: Select all
<?php
include 'session.inc';
function check_auth() { return 4; }
?>
<html>
<head><title>Login</title></head>
<body>
<?php
if (isset ($_POST['login']) && ($_POST['login'] == 'Log in') &&
($uid = check_auth($_POST['email'], $_POST['password'])))
{
/* User successfully logged in, setting cookie */
$_SESSION['uid'] = $uid;
header('Location: http://kossu/session/index.php');
} else {
?>
/* HTML form comes here */
<?php
}
?>
</body>
</html>Code: Select all
<?php
ini_set('session.use_cookies', 1);
ini_set('session.use_only_cookies', 1);
session_start();
?>thanks