[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1184
  • Last Modified:

PHP5 Session Handling

Hello Experts,
I have a question about PHP5 Sessions, I have been using some PHP4 Code for a couple of years and suddenly I started getting some funny messages on the bottom of the page.  such as:
Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0.

It seems that my Session handling Code is pretty dated.  After looking for PHP5 Session Management guides on the net I am confused could someone please show me the php5 replacements for my PHP4 session codinge below.  Thanks.
//Server ID:
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"))
 
//session start
session_start();
 
// Receiving variables from form
$kdnkdnr = $_POST['kdnkdnr'];
 
//Register form Variable to session
session_register ("scznrz1");
$HTTP_SESSION_VARS ["scznrz1"] = $sczn1z1;
 
// Place Session variable id into local variable
$kdnuser = $_SESSION['kdnuser'];

Open in new window

0
swedesamurai
Asked:
swedesamurai
1 Solution
 
gamebitsCommented:
//Register form Variable to session
session_register ("scznrz1");
$_SESSION ["scznrz1"] = $sczn1z1;

// Place Session variable id into local variable
$kdnuser = $_SESSION['kdnuser'];

0
 
swedesamuraiAuthor Commented:
Quick and Accurate Thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now