Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
PHPToolkit and $_SESSION
For the site I am building, I need to be able to store the nsClient created at login for future requests, but when storing it in $_SESSION, it doesn't seem to work quite right. Is there a better way of maintaining the session with Netsuite than this?
For the record I am doing the following to store the nsClient object into $_SESSION:
[PHP]
session_start();
if( (!array_key_exists('email', $_POST) || !array_key_exists('passwd', $_POST))
|| !$_POST['email'] || !$_POST['passwd']
) {
$_SESSION['error'] = 'No email or password provided.';
header("Location:/login.php");
exit;
}
require_once('Netsuite/PHPtoolkit.php');
$email = $_POST['email'];
For the record I am doing the following to store the nsClient object into $_SESSION:
[PHP]
session_start();
if( (!array_key_exists('email', $_POST) || !array_key_exists('passwd', $_POST))
|| !$_POST['email'] || !$_POST['passwd']
) {
$_SESSION['error'] = 'No email or password provided.';
header("Location:/login.php");
exit;
}
require_once('Netsuite/PHPtoolkit.php');
$email = $_POST['email'];
0