There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen blue screen of death boot bsod computer connection crash css dell display driver drivers email error explorer firefox firefox 3 hard drive internet internet explorer itunes laptop lcd malware monitor network networking outlook outlook 2003 outlook express printer problem problems ram router security slow software sound sprtcmd.exe trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
$_SESSION variables not being passed.


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
DrP's Avatar
DrP DrP is offline
Senior Member with 481 posts.
 
Join Date: Jul 2005
Location: UK
Experience: What's a compoota?
30-Oct-2006, 01:30 AM #1
$_SESSION variables not being passed.
I have this site for my school where, when people log on, the following are set:

$_SESSION['user_logged']
$_SESSION['user_password']
$_SESSION['level']
$_SESSION['class']
$_SESSION['logged'] = TRUE

They are then redirected back to the original page which contains:

session_start();
if ((isset($_SESSION['user_logged']) &&
$_SESSION['user_logged'] != "") ||
(isset($_SESSION['user_password']) &&
$_SESSION['user_password'] != "")) {
$_SESSION['logged'] = TRUE;
}

This shows me whether they are logged in or not. When redirected from logging in this works fine and the screen for logged users shows. However, as soon as you move to another page (which features the same login check) the user is shown the non-logged user screen. I'm sure this means the information is not being passed between pages.

What I don't understand is this works completely without problems when I run it on my server at home, but it won't work on the 'live' server!

Can anyone help?
__________________
Clive
haswalt's Avatar
Computer Specs
Senior Member with 416 posts.
 
Join Date: Nov 2004
Location: South Coast, UK
Experience: Advanced
30-Oct-2006, 03:27 AM #2
you definately have session_start() at the top of each page?

check the session settings on the live server.
DrP's Avatar
DrP DrP is offline
Senior Member with 481 posts.
 
Join Date: Jul 2005
Location: UK
Experience: What's a compoota?
30-Oct-2006, 09:21 AM #3
Yep, session_start() is at the beginning of each page. Like I said, it works fine when tested on my own server at home.
I've tried contacting the county advisors about the server settings, but the head honcho doesn't seem to know anything about them and is unable to help. Instead I have to contact the company that maintain the servers, via the county advisors - something I feel will take weeks, possibly.
What exactly should I be asking about re the server settings?

EDIT: Have looked around and I believe I need to do this...
1. Get a copy of the server's php.ini file and put it into my root directory.
2. Edit php.ini to direct sessions towards a tmp folder.
3. Create the temp folder.
4. Ka-ching!
Does that sound about right? If so, all I've got to do is begin the (possibly) difficult task of being given a copy of the server's php.ini file!
__________________
Clive

Last edited by DrP : 30-Oct-2006 12:10 PM.
covert215's Avatar
Account Disabled with 2,651 posts.
 
Join Date: Apr 2006
Experience: Web Designer
30-Oct-2006, 04:57 PM #4
You can put a php.ini file in your directory and only enter the necessary changes. If I make a php.ini file that only changes 1 detail, it will inherit the server's main file and only override the listed one.
DrP's Avatar
DrP DrP is offline
Senior Member with 481 posts.
 
Join Date: Jul 2005
Location: UK
Experience: What's a compoota?
01-Nov-2006, 07:54 AM #5
Are you sure?
I looked into it here:
http://www.washington.edu/computing/...g/php-ini.html
and that says the opposite...
cnelson04's Avatar
Senior Member with 900 posts.
 
Join Date: Dec 2003
02-Nov-2006, 03:18 PM #6
Just download php.. copy the php.ini change the settings you want, upload it. And your done? I think this will work correct?
covert215's Avatar
Account Disabled with 2,651 posts.
 
Join Date: Apr 2006
Experience: Web Designer
02-Nov-2006, 04:34 PM #7
That's quite a bit of work right there. Its not even remotely efficient.
DrP's Avatar
DrP DrP is offline
Senior Member with 481 posts.
 
Join Date: Jul 2005
Location: UK
Experience: What's a compoota?
03-Nov-2006, 12:44 AM #8
Cnelson, will that really work? Won't I need to make sure that the php.ini file I upload has the settings for everything else the same as the server at the moment?
Also, will I need to restart the server for the new settings to take effect?
cnelson04's Avatar
Senior Member with 900 posts.
 
Join Date: Dec 2003
03-Nov-2006, 06:39 AM #9
I'm not sure about the restart but i'm sure some of the setting will be a little differant. I don't think it would be anything to change your server behavior. I've never tried it before so i'm not positive but on paper it seems like it would work. But there could be other complications me and you aren't thinking of, or like i said it could and probably will work. Or just ask for a copy of the php.ini file form the host. -cnelson.
__________________
Help me, out visit my site! Cnelson Creations
"College student by day, web designer by night.. "
covert215's Avatar
Account Disabled with 2,651 posts.
 
Join Date: Apr 2006
Experience: Web Designer
03-Nov-2006, 08:07 AM #10
All you need is a blank file called php.ini that hs whatever settings you need changed. The rest will be default.
cnelson04's Avatar
Senior Member with 900 posts.
 
Join Date: Dec 2003
03-Nov-2006, 04:46 PM #11
Well the artcle he posted says the exact oppisite thing. but if your right, then go with his idea. -cnelson.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:51 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.