Connecting Tech Pros Worldwide Forums | Help | Site Map

session variables

darksteel21's Avatar
Newbie
 
Join Date: Jul 2008
Posts: 15
#1: Jul 17 '08
hi to all,
i am a programmer here in our company,using php and actually my first job...i have problems regarding displaying of session variables..when i created my application in my local apache server, session variables are working fine but when i uploaded my application on our company's remote server, they are not working anymore or they don't display the values of my session variables..are there any configurations on the remote server??or do ihave to revise my codes??
i hope someone could advice me on this...Thanks

Newbie
 
Join Date: Jan 2008
Location: Malaysia
Posts: 28
#2: Jul 17 '08

re: session variables


it is sound like my last time problem, i guess probably your company server doesn't set session.save_path variable correctly?

you try check the apache configuration in your server httpd.config, is it set to correct path.
darksteel21's Avatar
Newbie
 
Join Date: Jul 2008
Posts: 15
#3: Jul 17 '08

re: session variables


ah i see...i guess i dont have the permission to configure our remote server and besides i don't know yet how to operate unix servers..by the way i did some work around and it solved my problem...before i used the session_register in creating session variables i just changed it to $_SESSION in assigning values to my session variables, but i wana know what's the difference between the two functions??why is the session_register wont work on our remote server while the $_SESSION works??is it in the configuration that you are saying a while ago??....and by the way thaaaaaaaaaaaaaaaaaanksss!
dlite922's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Posts: 1,095
#4: Jul 17 '08

re: session variables


Sessions only work for one domain

if the part between the "http://" and "/page.php" changes at any point, it will get lost.

Pay attention to this in your pages before pointing the finger.


Dan
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,751
#5: Jul 17 '08

re: session variables


Hi.

The session_register function is an old, deprecated, method of registering session variables.
It requires that the register_globals directive is enabled on your server, which it is not by default in PHP5. It is also not recommended to turn this on for security reasons.
Not to mention that this directive will be completely removed in PHP6.

Using the $_SESSION array is the ideal way to handle sessions in PHP5 and later versions of PHP4.
Reply