How to set the value of a cookie to a field on an ARSystem form.

Version 2

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    Remedy AR System Server


    BMC Remedy AR System Server


    How to set the value of a cookie to a field on an ARSystem form.



    Legacy ID:KA334042

    If you do not already have the cookie created, you can run the following javascript to create one: 

    function SetMyCookie() 

    var cookieName = document.cookieForm.cName.value; 
    var cookieValue = document.cookieForm.cValue.value; 

    document.cookie = cookieName+"="+cookieValue; 


    If you already have the cookie created and want to use the value of it to set an ARSystem field, you can run the following javascript to do so. You will need to manually edit the name of the cookie and the field you want to set the value to. See the comments ("//") within the script. 

    function SetCookieValueToField()  
    if (document.cookie.length > 0)  
    // Specify the cookie you wish to get the value of 
    var cookieName = "JSESSIONID";  
    // Specify the database ID of the ARSystem field you want to set. It must include the prepending "F" 
    var arsysfieldID = "F536870918";  
    begin = document.cookie.indexOf(cookieName+"=");  
    if (begin != -1)  
    begin += cookieName.length+1;  
    end = document.cookie.indexOf(";", begin);  
    if (end == -1) end = document.cookie.length;  
    var cookieVal = document.cookie.substring(begin, end);  

    This javascript code can be added to one of the many included javascript files (/apps/shared/javascript) from within the Mid-Tier directory structure or it can be added inside the <HEAD> and </HEAD> tags of the form "Source" tab from within the Administrator tool. 

    You can then invoke the javascript with an active link Run Process, using the following command line syntax: 

    This active link, if running when the page opens, should execute on Window Loaded. 


    Article Number:


    Article Type:


      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles