Trouble checking SESSION cookie


Posted on 16th Feb 2014 07:03 pm by admin

I am trying to use $_SESSION cookies to verify admin privileges .
I don't understand why this is not working:
/*everything above here is working*/
$session = mysql_fetch_array($session_query);
$type = $session['admin_type'];
$name = $session['admin_name'];
$level = $session['admin_level'];
$_SESSION['type'] = $type;
$_SESSION['name'] = $name;
$_SESSION['level'] = $level;
/*This is returning false*/
if(isset($_SESSION['type']))
{
if($_SESSION['type'] == 'regional')
{
header('Location: all_admin.php');
exit();
}
}
What am I not doing right

No comments posted yet

Your Answer:

Login to answer
269 Like 38 Dislike
Previous forums Next forums
Other forums

Menu restriction
How can I restrict the individual menu that would appear when a user logs in so that all users are c

UDS 4.0 Datatype issue
UDS 4.0.322 -- connecting to NI Labview 9.0

When using connection method: Cache with live

PHP and SMS
Hi all forum members. I am new here and am unsure what category shoild I post this in.
Moderator

BSP Ext - tableView - Sort - NEWBIE
Hi,
I have been trying to get the sort to work. I have defined the column definitions by fillin

I apologise! It's a newbie to PHP feedback form problem!
Hi,

I am a total newbie to PHP. I am also a unemployed and need to get a job. So after 100% r

PHP mail() rejected by SMTP
I'm currently working on a newsletter application which is installed on a windows 2003 server runnin

PHP hyperlinks generator - HELP plz
Hi

I need some help to get this done using php:


1 - I have few hyperlinks say 500

gmdate() - want 1 hr before time
Hi,
I am using php gmdate().
Now I am entering all dates in my dbase using gmdate("Y-m-d

media recovery
Hi,
i startup the database i got the error

SQL> startup
ORACLE instance started.

Warning: Cannot modify header information - headers already sent by (output sta
Warning: Cannot modify header information - headers already sent by (output started at /home/praylif

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash