Vars not getting returned.

I'm not getting vars back from a user file.  $_SESSION['Company_ID'] comes back as blank, but the other $_SESSION vars are ok.

Here's a screen print from the var(dump)
array(56) { ["User"]=> string(6) "BREEZE" ["Password"]=> string(6) "351CLV" ["First_Name"]=> string(5) "Glenn" ["Last_Name"]=> string(8) "Davidson" ["E_Mail"]=> string(21) "glenn@langsystems.net" ["Security"]=> string(1) "9" ["P_Format"]=> string(1) "5" ["UserID"]=> string(4) "GJJD" ["LSI_Ver"]=> string(3) "4.1" ["Menu_No"]=> int(1) ["Last_Page"]=> string(9) "index.php" ["Save_Last"]=> string(0) "" ["Message"]=> string(0) "" ["Error"]=> string(1) "N" ["PForm"]=> string(1) "N" ["Survey_Count"]=> string(1) "0" ["Number"]=> string(0) "" ["Street"]=> string(0) "" ["Address"]=> string(0) "" ["Data"]=> string(0) "" ["Old_Data"]=> string(0) "" ["Misc"]=> string(0) "" ["Insert"]=> string(1) "N" ["Count"]=> string(1) "0" ["Up_Down"]=> string(0) "" ["North"]=> string(0) "" ["South"]=> string(0) "" ["East"]=> string(0) "" ["West"]=> string(0) "" ["Map_Dir"]=> string(0) "" ["Location"]=> string(1) "M" ["District"]=> string(0) "" ["UNI_Q"]=> string(0) "" ["Logo"]=> string(0) "" ["Food"]=> string(1) "N" ["Vent"]=> string(1) "N" ["Corner"]=> string(1) "N" ["Company"]=> string(1) "N" [u]["Company_ID"]=> string(0) "" ["Comp_ID"]=> string(0) "[/u]" ["Browser_Name"]=> string(15) "Mozilla Firefox" ["Browser"]=> string(7) "Firefox" ["Browser_Version"]=> string(4) "59.0" ["Platform"]=> string(7) "windows" ["Custom1_Name"]=> string(0) "" ["Custom1_Php"]=> string(0) "" ["Custom2_Name"]=> string(0) "" ["Custom2_Php"]=> string(0) "" ["Back_R"]=> string(2) "77" ["Back_G"]=> string(3) "148" ["Back_B"]=> string(3) "255" ["Fore_R"]=> string(3) "255" ["Fore_G"]=> string(3) "255" ["Fore_B"]=> string(3) "255" ["Logo_Print"]=> string(35) "L a n g S y s t e m s , I n c ." ["Logo_PDF"]=> string(17) "Lang_Logo_PDF.jpg" } 

Open in new window

Here's a simple query with the results:
SELECT `First Name`, `User_ID`, `Password`, `Company_ID` FROM users WHERE USER = 'BREEZE' and PASSWORD = '351CLV'

Open in new window


Glenn 	GJJD 	351CLV 	10018855

Open in new window


I'm attaching the index.php and the LoginChk.php.  I did have this working.  I don't know what I screwed up.
index.php
LoginChk.php
breeze351Asked:
Who is Participating?
 
Chris StanyonCommented:
In your LoginChk.php file you do a query and set some SESSION values from the DB. You then redirect to index.php where you set some more SESSION variables. One of those is Company_ID, so whatever value you assigned to it from the database (in LoginChk) you then overwrite with the value from index:

$_SESSION['Company_ID'] = "";
1
 
Jim RiddlesPrepress/OMS SpecialistCommented:
The first thing that I would do is var_dump the $ROW variable and see what the value is for $ROW['Company_ID'];  It appears to be empty.
0
 
Julian HansenCommented:
Suggestion: Instead of creating numerous SESSION variables store your session in a single session object (stdClass or array).

Then save that to the session. Makes for much easier management.
1
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
breeze351Author Commented:
I just got it.  A-hole partner added $_SESSION['Company_ID'] = "";  to index.php.  Can I kill him?
0
 
Julian HansenCommented:
Can I kill him
Nope, sorry he is destined for promotion.
1
 
Chris StanyonCommented:
Why have accepted the answer you have when I told you exactly what the problem was and you've just confirmed it ???
1
 
Jim RiddlesPrepress/OMS SpecialistCommented:
I was wondering the same thing, Chris.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.