hinz
-
Posts
2 -
Joined
-
Last visited
Never
Posts posted by hinz
-
-
Someone pls help me!!
something wrong with my session.
here is the simple code from internet.
<?php
// page1.php
session_start();
echo 'Welcome to page #1';
$_SESSION['favcolor'] = 'green';
$_SESSION['animal'] = cat;
/*$_SESSION['time'] = time();*/
// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';
// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>
<?php
// page2.php
session_start();
echo 'Welcome to page #2<br />';
echo $_SESSION['favcolor']; // green
echo $_SESSION['animal']; // cat
/*echo date('Y m d H:i:s', $_SESSION['time']);*/
if(isset($_SESSION['username']))
return $_SESSION['username'];
else
// You may want to use SID here, like we did in page1.php
echo '<br /><a href="page1.php">page 1</a>';
?>
this is the result after I press the link in page1.php.
case 1
Welcome to page #2
1970 01 01 00:00:00
page 1
this is the result after I press the link in page1.php with session id.
case 2
Welcome to page #2
greencat2006 05 17 12:55:33
page 1
y my session cannot display in case 1 in IE ?
It work fine in the case 2 using IE.
If I use OPERA to test it, it work fine for both cases.
pls help me.....:)
$_SESSION problem
in PHP Coding Help
Posted
Make sure you have cookies enabled in the browsers you're testing with and have no extensions that block cookies. Also, make sure that any third party software like network security isn't blocking sessions.
Take a look at our session troubleshooting guide:
[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=31047&view=findpost&p=157705\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...ndpost&p=157705[/a]
Read ALL items in the list. Try just the simple code script in item #10.
[/quote]
Thanks a lot.. i found the answer!! it just a php.ini setting problem..