Jump to content

How do I create superglobal session variables?


webmaster1

Recommended Posts

I've read the manual. I have the following:

 

<?php
if($count==1){
session_register("loginusername");
session_register("loginpassword");
header("location:/somewhere");
}
?>

 

Since this approach is deprecated I've tried replacing the functions with the superglobals:

 

<?php
if($count==1){
$_SESSION['loginusername'] = $loginusername;
$_SESSION['loginpassword'] = $loginpassword;
header("/somehwere");
}
?>

 

 

How do I correctly define the session variables? Should I be using session_start?

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.