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

How to insert random unique values in 2 columns ?
I have table with 2 columns

Create Table code_for_code (
first_code varchar2(10) uni

duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or no

How do I send data using an html link
Hi

If I have
<a href="main_file.php">

How do I send data t

cookie problem
I hv a website url
In this site main menu functionality based on cookie when user click on parti

Help with echo()
I'm having some problems with this code:

Code: echo '
<A HREF="jav

How can I Compare two xml documents?
Hi all,

I am doing a POC for my project and I am using XE database 10g version.

how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are tw

Using the $_GET variable to view certain records
Hello,

First let me explain my problem, I have 2 pages the first page pull a list of Guide ti

Please help with code for SMTP authenticated PHP email form
Hello, I'm creating a PHP email form, and for this particular server, I have to use SMTP Authenticat

Error with login script
I am getting an error with my login script:

Error:
Code: Warning: Cannot modify header inf

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