{
  "synLogic": "unsigned int $ret \u003d $api();",
  "help": "The ns_get_sessid API is used to get the current session id. This is helpful in case where you want to add some custom logic in your script. For example: In case you want to pass session id as header in your request , you can use this API to get the session id.",
  "notes": "",
  "returns": "Returns the integer value as session id",
  "arguments": "",
  "parameterization": "",
  "component": [
    {
      "id": "$ret",
      "type": "TextField",
      "label": "Return Variable",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "First character must be Alpha.\r\nOther characters are Alpha, Numeric or Underscore",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,63}$",
        "required": false,
        "min": 0,
        "max": 0,
        "method": "isValidVar(arg)"
      },
      "quotes": true
    }
  ],
  "name": "ns_get_sessid",
  "syntax": "unsigned int ns_get_sessid()",
  "javaSyntax": "",
  "jsSyntax": "ns_get_sessid()",
  "cEx": "flow()\n{\n  int  user_sess_id=0;\n  sprintf(user_sess_id,\"%d%d\",ns_get_sessid(),ns_get_userid()); // To get the session and userid \n  ns_save_string(user_sess_id, \"UsersessionID\"); // To save the value in NS parameter UsersessionID\n\n  // in this example header Usersession with userid+sessionid as value\n  ns_start_transaction (\"AddToCart\");\n  ns_web_url (\"getcart\",\n    \"URL=https:\//184.105.52.73:4444/ProductUI/productSummary/cartsummary\",\n    \"HEADER=Usersession:{UsersessionID}\",\n  );\n  ns_end_transaction(\"AddToCart\", NS_AUTO_STATUS);\n}",
  "javaEx": "",
  "jsEx": "  console.log(\"Error in session for NVM\u003d, User\u003d, Session\u003d \\n\", nsApi.ns_get_nvmid(), nsApi.ns_get_userid(), nsApi.ns_get_sessid());",
  "insertStrC": "ns_get_sessid();",
  "insertStrJava": "",
  "insertStrJs": "ns_get_sessid();",
  "description": "The ns_get_sessid API is used to get the current session id."
}
