Hi, i'm having problems with sessions.
I create a session, but I can't print a session variable to the screen using html code, i don't know what's wrong but i think it's something related to my php configuration...
i'm running windows xp, php5 and apache 2.2.
here the code of a simple test.php:
<?php
session_start();
$user='Hackeralho';
$pass='xxxx';
$_SESSION['user'] = $user;
$_SESSION['pass'] = $pass;
printf("user: %s pass: %s\n", $_SESSION['user'], $_SESSION['pass']);
?>
<html>
<head>
<title>teste</title>
</head>
<body>
<p></p><b>Hi <?=$_SESSION['user']?></b></p>
</body>
</html>
when execute it the result is the following:
user: Hackeralho pass: xxxx
Hi
it doesn't shows the 'user' session variable in the html 🙁
I've checked the session cookie and it was created and had the following data inside:
user|s:10:"Hackeralho";pass|s:4:"xxxx";
my phpinfo() is:
Directive Local Value
session.auto_start On
session.bug_compat_42 Off
session.bug_compat_warn On
session.cache_expire 180
session.cache_limiter nocache
session.cookie_domain localhost
session.cookie_lifetime 0
session.cookie_path c:/php/tmp
session.cookie_secure Off
session.entropy_file no value
session.entropy_length 0
session.gc_divisor 1000
session.gc_maxlifetime 1440
session.gc_probability 1
session.hash_bits_per_character 5
session.hash_function 0
session.name PHPSESSID
session.referer_check no value
session.save_handler files
session.save_path c:/php/tmp
session.serialize_handler php
session.use_cookies On
session.use_only_cookies Off
session.use_trans_sid 0
Anybody can see what's wrong?
thanks in advance...