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

Php navigation
I have four buttons on a php page.
If i click a button it will redirect to different php pages.

Email Processor
I have a few questions so this post will be a larger one! Sorry, but I'm a bit of a PHP newbie so be

echo $rows help
Hi all,

Hopefully something simple that I don't know!

I have this:

Code: [Selec

Recording popularity by day, week.. all time?
Hey everyone, I'm creating a site designed around users uploading music. How can I implement a syste

Seperate team from score
I am writing a site that does a NFL Pick 'em type application and I have a feed that gives me the sc

Looking for help reading a .txt or .ini file and outputting the info.
I have a file called Info.ini and It has the following info:
Code: [General]
Online=0
I wou

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

PHP form authentication
Hi guys,

what am trying to achieve is this: Whenever a user tries to login to my website, an

need help in update query
hi
i have a dynamic form. i need help in how can i use update query when values from dynamic for

with clause
hi all, i have a big query that usually access the same table more than once. for example, i have s

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