Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Using non-WF cookies as &vars

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using non-WF cookies as &vars
 Login/Join
 
Platinum Member
posted
Hi we are trying to pass cookies into our servers to set &VARS and are not having much luck. Here is the code I am setting in the 'customer settings' section of the server:
-----------------------------------------------------------------------------
wfvar1=ClassFilter
wfvar2=SubClassFilter
wfvar3=CustomerFilter

CLASS_COOKIENAME=Class
SUBCLASS_COOKIENAME=Subclass
ACCT_COOKIENAME=Account
[call] CopyHTTPCookieToWFVar(CLASS_COOKIENAME,wfvar1)
[set] ClassFilter (pass)
[call] CopyHTTPCookieToWFVar(SUBCLASS_COOKIENAME,wfar2)
[set] SubClassFilter (pass)
[call] CopyHTTPCookieToWFVar(ACCT_COOKIENAME,wfvar3)
[set] CustomerFilter (pass)
-----------------------------------------------------------------------------

I am not sure if I am setting it right or what exactly is going on but essentially we are trying to pass a class, subclass, and account number from a cookie to 3 &VARS (classfilter, subclassfilter, customerfilter).

Any help would be great, thanks.

PS: the [call] and [set]s are actually in <> but I cannot use those when I post here.


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
 
Posts: 153 | Location: Chicago, IL | Registered: February 24, 2006Report This Post
Expert
posted Hide Post
An example of the syntax for passing variables that I'm familiar with (5.3):

WF_PROGRAM=&CGI_PROG
<set> WF_PROGRAM (pass)

I have never passed cookie values so I'm not sure of that part.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
I assume the example you gave is for passing WF parameters.

Anyone else have any other ideas/suggestions?


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
 
Posts: 153 | Location: Chicago, IL | Registered: February 24, 2006Report This Post
Expert
posted Hide Post
quote:
CopyHTTPCookieToWFVar

is not supplied by IBI - it it written by you?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
That should be an IBI provided function. From another post:
https://forums.informationbuilders.com/eve/forums/a/...251011051#8251011051

They used the same function in that example and I was also given a generic example by an IBI consultant who was onsite a week ago.


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
 
Posts: 153 | Location: Chicago, IL | Registered: February 24, 2006Report This Post
Expert
posted Hide Post
I did not realize this was an IBI provided Java class (or something).

I'll play around a bit, meanwhile, here's some doc I found on my PC using Google Desktop:

file:///C:/ibi/WebFOCUS53/ibi_html/javadoc/ibi/webfoc/WFEXTDefault.html#CopyHTTPCookieToWFVar(java.lang.String[], javax.servlet.http.HttpServletRequest, java.lang.String, java.lang.String)

CopyHTTPCookieToWFVar
public java.lang.Long CopyHTTPCookieToWFVar(java.lang.String[] output,
javax.servlet.http.HttpServletRequest request,
java.lang.String cookieName,
java.lang.String wfVarName)This method copies the contents of an HTTP cookie into a WFServlet variable.

Parameters:
output - The array of one string that will be used to return ampersand delimited name/value pairs back to the caller. This argument is an internal argument that WFServlet passes to each user method that gets called from the WFS file.
request - The current HTTPServletRequest passed from the servlet. This argument is an internal argument that WFServlet passes to each user method that gets called from the WFS file.
cookieName - The name of the HTTP cookie from which the value should be retrieved.
wfVarName - The name of the WF Servlet variable that will contain the value.
Returns:
Returns 0 Upon Success
Returns 999 Upon Failure


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
The following works for me.

JSESSIONID is a cookie value set by WF BI Dashboard.

I added the following to my Custom Settings:

wJSESSIONID=vJSESSIONID
cJSESSIONID=JSESSIONID
<call> CopyHTTPCookieToWFVar(cJSESSIONID,wJSESSIONID)
<set> vJSESSIONID(pass

I'm not sure if I've confused the issue, but I used the same name everywhere, I just added a prefix where necessary - w for web, c for cookie, v for variable.

The first thing I would do is verify that the cokkie values you want to pass actually exist.

I use the following JavaScript to display the cookies for the current page:

javascript:if(document.cookie.length<1){alert('No cookie for this site.')}else{alert('Cookie for this site:'+document.cookie)}

I've got this code embedded in a Shortcut on the Links toolbar of IE.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Using non-WF cookies as &vars

Copyright © 1996-2020 Information Builders