Hi all,

I am not able to get the session in IE.Its Working Fine in Mozilla.I tried a lot to Overcome this Problem.Session registration was Successfull.After Successfull login i am redirecting to some Other page.Here Session is Not Coming.Anybody can help me for Doing this?


Rajeev

Hi,

I am attaching the details here
1)If it is a Successfull login :-

if($chkpass==$pass)
{
session_start();
$_SESSION=$uname;
$_SESSION="";
//echo "Session Uname Is:".$_SESSION;
header("Location: adminmain.php?uname=".$uname);
}
2)Next page:-

-----Html Codings--------
----------------------------
<?php include 'admintop.php'; ?>
---HTML Code-----------
--------------------------
<?php
if(isset($_REQUEST)=='logout')
{
//echo $_GET;
$_SESSION = array();
if (isset($_COOKIE[session_name()]))
{
//echo " ".$_COOKIE[session_name()];
setcookie(session_name(), '', time()-42000, '/');
}
unset($_SESSION);
session_destroy();
$_SESSION = "";
header("Location: login.php?mod=".$mod."&out=".$out);
exit();
}
if($_SESSION == "")
{
header("Location: login.php");
exit();
}
?>
----html code--------------------
-----------------------------------


3)That include admintop.php page

<?php
include 'includes/pnAPI.php';
pnInit();
session_start();
//Connection with the database and getting the tables.
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
//$menu1=ereg_replace("&","\&",$menu);
//to get the table name
$admin=$pntable;
$admincolumn=$pntable;
$sel_qry="select * from $admin where $admincolumn[user_name]='".$uname."'";
//echo $sel_qry;
$result=$dbconn->Execute($sel_qry);
list($slno_dis,$user_dis,$pass_dis,$level_dis,$level_name_dis,$login_date_time_dis)=$result->fields;
//echo $user_dis.'<br>'.$pass_dis.'<br>'.$level_dis;
//echo '21:'.$uname;
//$_SESSION=$uname;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/gwstyle.css" type="text/css">
<link href="css/mrpl-css.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function getClockTime()
{
var now = new Date();
var hour = now.getHours();
var minute = now.getMinutes();
var second = now.getSeconds();
var ap = "AM";
if (hour > 11) { ap = "PM"; }
if (hour > 12) { hour = hour - 12; }
if (hour == 0) { hour = 12; }
if (hour < 10) { hour = "0" + hour; }
if (minute < 10) { minute = "0" + minute; }
if (second < 10) { second = "0" + second; }
var timeString = hour +
':' +
minute +
':' +
second +
" " +
ap;
return timeString;
}


</script>
</head>

<body>
<table width="760" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="238">
<?php
$admin_menu=$pntable;
$admincolumn_menu=$pntable;

$sql_list_menu="select $admincolumn_menu[menu_id] from $admin_menu where $admincolumn_menu[level]='".$level_dis."'";
$sql_list_menu_res=$dbconn->Execute($sql_list_menu);

while(list($menu_id_dis)=$sql_list_menu_res->fields)
{
$sql_list_menu_res->MoveNext();
$me=$menu_id_dis.',';
//echo $me;
}

?>

</td>
<td width="408">&nbsp;</td>
<td width="114">&nbsp;</td>
</tr>
<tr>
<td align="center" class="pviiscroller"><span class="pviiscroller">welcome <?php echo $_SESSION; ?></span></td>
<td align="center" class="pviiscroller" > Your Last Logged on was <? echo $login_date_time_dis; ?>
</td>
<td class="pviiscroller" align="center"><a href="adminmain.php?mod=logout&out=<? echo $user_dis; ?>">Logout</a></td>
</tr>

</table>
<?php
if($_SESSION == "")
{
header("Location: login.php");
exit();
}
?>
</body>
</html>

I am getting Session in this page in mozilla.But not in IE.
Please check this Code.......

With regards,
Rajeev

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.