learning "session" in PHP
Posted: Thu Sep 08, 2005 2:24 am
hi guys,
I am studying the "session" in php from PHP Power Programming.I got into doubt in the following thing.
There ia a script like
now the code for "session.inc" is like below
well, can anybody guide me about what exactly the session.inc is doing.Is it setting the "session" for this particular page or is it a gloabal level setting for php like the way i set in php.ini file.Does this script changes the php.ini file or its simply for this paricualr page only?Seems simple but as a newbe,I need clarification.
thanks
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