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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.
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