Jump to content

$_SESSION problem


brosjr

Recommended Posts

Hi all,

 

I'm in trouble with a strange problem. At the system login a script sets a $_SESSION['status'], this keeps user status for admin (a), user (u), and so on...

 

In another part of the system I need to post a value also called 'status':

 

<input value="N" type="hidden" name="status"/>

 

and this 'status' value has nothing to do with 'status' session. The problem is that when I post the value 'N' it overwrite the session value, crashing the system then.

 

The most strange is that on the localhost the problem does not happen, it only occurs on the server.

 

Any clue?

 

Thankx  ;D

Danilo Jr.

Link to comment
https://forums.phpfreaks.com/topic/236804-_session-problem/
Share on other sites

Your web host has register_globals turned on.

 

If none of your existing scripts are dependent on this feature (overwriting session and program variables from same named post/get/cookie variables), then you should turn register_globals off ASAP because this is a security hole (being able to set session variables to anything you want) and a lot of web sites have been taken over.

 

If php is running as a CGI application on your web server, you should be able to turn this setting of in a local php.ini. If php is running as an Apache Module on your web server, you should be able to turn this setting off in a .htaccess file.

 

FYI: register_globals were turned off by default over 9 years ago in April of 2002.

Link to comment
https://forums.phpfreaks.com/topic/236804-_session-problem/#findComment-1217314
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.