Session Management in SuiteCommerce Advanced (SCA)

Session management in SuiteCommerce Advanced (SCA) relies on cookies to track and manage user interactions. There are three primary cookies used for this purpose: JSessionID NLvisitor NLshopperID These cookies are marked as HttpOnly, meaning they cannot be accessed or modified through frontend JavaScript. This enhances security, as HttpOnly cookies can only be managed by the… Continue reading Session Management in SuiteCommerce Advanced (SCA)

Managing Cookies in SuiteScript

Setting Cookies To set a cookie in SuiteScript, you modify the HTTP response headers within a Suitelet. Example: Setting a Cookie in a Suitelet /** * @NApiVersion 2.x * @NScriptType Suitelet */ define([‘N/https’], function(https) { function onRequest(context) { if (context.request.method === ‘GET’) { // Generate a session token or any data you want to store… Continue reading Managing Cookies in SuiteScript

What Are Cookies?

Cookies are small pieces of data stored on the user’s browser by a website. They are sent back to the server with each subsequent request, allowing the server to recognize the user and maintain stateful information across different pages and sessions. Common Uses of Cookies: Session Management: Keeping users logged in as they navigate the… Continue reading What Are Cookies?

Save the ID of the image clicked in the cookie session in Next Js

Install js-cookie: Run this command in your project to install js-cookie: npm install js-cookie Import js-cookie into your component. Set a cookie when an image is clicked. const handleImageClick = async (image) => {   try {    const updatedViewCount = image.viewCount + 1;    // Set a cookie when an image is clicked    Cookies.set(“clickedImageId”, image.id, { expires:… Continue reading Save the ID of the image clicked in the cookie session in Next Js

Cookie Authorization Validation

Cookie Authorization Validation refers to the process of testing and verifying how a web application uses cookies to enforce user authorization and access control. This type of testing ensures that the application correctly validates and manages cookies to prevent unauthorized access to protected resources. Key Aspects of Cookie Authorization Validation: Session Management: Validation of Session… Continue reading Cookie Authorization Validation

Accessing cookies in client script

The following function can be used to access cookies value in client script: const sessionCheckScript = ‘<script>’ +      ‘function getCookie(name) {‘ +     ‘const value = “; ” + document.cookie;’ +      ‘const parts = value.split(“; ” + name + “=”);’ +      ‘if (parts.length === 2) return parts.pop().split(“;”).shift();’ +        ‘}’ +     ‘var sessionToken = getCookie(“session_token”);’ +      ‘if… Continue reading Accessing cookies in client script

Clear Browser Cache and Cookies in NetSuite

Some common NetSuite scenarios are:  When users customized a Form (created, moved or deleted new fields) and the changes are not being reflected  When users switched from one role to another and the tabs in Menu are not changing. Let’s say you have Sales Center on one role and Support Center on another role and… Continue reading Clear Browser Cache and Cookies in NetSuite