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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
cookie deletion
 Login/Join
 
Member
posted
Hi -
I was wondering if anyone has ever run into a situation like the following (I'll try to make it breif):
When you log onto our application, we store a user id and other variables in a cookie. Throughout the app, we access those variables via the cookie. There is one focexec that we run where when we process about 20 records, it works fine. (The fex called is in a loop from 1 to the number of records chosen and inserts new rows into a DB2 table) If we process more than 20 records the loop fex still works, but when it comes back to display the HTMLFORM page for the output - for some reason it deletes the cookie and it cannot find the variables that we need for the page.
What I do not understand is why the cookie is being deleted. My first guess is that it has something to do with the size of what we are processing because it works perfectly fine on a smaller amount of records.
I have tried many different things even creating the cookie again right before the page is loaded, but that still doesn't work - it can't find it.
Just wondering if anyone has run into a similar problem with cookies.

Thanks.
 
Posts: 13 | Location: Boston | Registered: December 22, 2004Report This Post
Expert
posted Hide Post
Could it have something to do with the date/time the cookie expires?


This JS function creates a cookie:
// Sets the value of a cookie specified by "name" ------------------------------
function fnSetCookie(name, value, expires, path, domain, secure)
{
var argv = fnSetCookie.arguments;
var argc = fnSetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;

document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
This JS code creates a variable for Expiry Date (probably could be done simpler):
// Set up Cookie Expiry Date
var v100Days = (24 * 60 * 60 * 1000) * 100; // 100 Days in milliseconds
var vExpDate = new Date(); // Create a Current Date object
vExpDate.setTime(vExpDate.getTime() + v100Days); // Add 100 days to Current Date
This JS code calls the create cookie function:
fnSetCookie('gcr_login','AUTO',vExpDate,'/');
I hope this helps.

This message has been edited. Last edited by: <Maryellen>,


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
Member
posted Hide Post
Thanks for the info Francis, but I don't think it has to do with expiration. When we create the cookie, we don't set an expiration date so the default is that the cookie is stored in memory and it expires when the browser closes. I did experiment with making the cookie expire at the end of the year so that I could see the cookie on my PC. It still deleted the cookie even when it was in my Temporary Internet Files directory
 
Posts: 13 | Location: Boston | Registered: December 22, 2004Report This Post
Expert
posted Hide Post
Paw,

If you let the default of timeout on browser closure, could your problem be down to cookie expiration owing to lengthy nil response from the server? i.e. Browser sitting there waiting for a response from the server (which is where your loop is taking place) and thinking "they've forgotten me" and deleting the cookie?

You could always try and set the expiry date/time to something that will exceed the worse case scenario of your requests, to see if that helps?
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
Tony, thanks - that is something to consider. I didn't know that if the server is not getting any response it may delete the cookie - good to know. The looping is happenng on the mainframe side so it is not sending anything to the server until it is done.

However, I did try setting an expiration date and the same thing happened. For example, I set the expire date to the last day of the year (12-31-2005). Before executing the looping, I could see the cookie in my Temp Internet files folder. After the looping finished and it came back to the HTML page to display - cookie was gone.
 
Posts: 13 | Location: Boston | Registered: December 22, 2004Report This Post
Member
posted Hide Post
Thanks to those who responded. FYI for anyone else who may come across this situation. We use dialogue manager amper (&) variables in the application. What we didn't know is that those amper are stored in a cookie. In a loop we have, we stored quite a bit of data in an amper array variable. The variable was causing the cookie to go over the 4K cookie size limit, thus deleteing the cookie.
 
Posts: 13 | Location: Boston | Registered: December 22, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders