Solved

keep the Domino session alive from a external site

Posted on 2002-04-24
12
727 Views
Last Modified: 2013-12-18
I need to keed the session alive from a external site openend in a new window from the main one.

 In the common frame for all pages I have the following javascript:

<html>
<head>
</head>
<body onLoad="keepAlive();">

<SCRIPT LANGUAGE="JavaScript" >
function keepAlive() {    
            ....
           document.write('<img src="https://dominoserver/icons/imag..gif" WIDTH=1 HEIGHT=1>');
           setTimeout('keepAlive()',10000); //here is the error ; 10000=10 secs-> it is just a test
}
</script>
Hello
</body>
</html>

But:

1) Why I get an error 'keepAlive()  is not defined' after 10 seconds  (when the line setTimeout('keepAlive()',600000); ) is executed?

2) I realized I can't use the property of the Navigator View Source Code until I have the error (after 10 secs). It seems like if the page is blocked. How can I keep the session alive without blocking the page? Is a bad idea to call the setTimeout in a function called in the onLoad event?

Thanks.
0
Comment
Question by:perevicente
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 10

Expert Comment

by:zvonko
ID: 6965426
This "progress bar" :-) is working...
http://www.experts-exchange.com/jsp/qShow.jsp?ta=webdevgen&qid=20285489

Look for some details in it.

Even if you succeed in pasting an image every 10 seconds into actual page, how do you assure it is not coming from browsers cache :-)

See my answers to upper question for more details about browser session.

By the way: the URL of your <img> has .. in it

Good luck,
zvonko

0
 

Author Comment

by:perevicente
ID: 6965583
I'm talking about Domino session (this is the Lotus Notes section of the forum, isn't this?). So, to keep the Domino session alive once it has been enable from the server properties and once the user has been autenthificated in the server (the DomAuthSessId is set), is enough with making a simple calling to the server (that is the reason I use the line code: document.write('<img src="https://dominoserver/icons/imag.gif" WIDTH=1 HEIGHT=1>').

But the goal of my question is just to know why I have the error I mentioned and how can I keep the session alive without blocking the page? The function keepAlive must be called from an event like onLoad (or something similar) but without blocking the page, without errors and with a setTimeout making a recall each x minutes.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6965652
Define the script block in Head.../Head section

~Hemanth
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:perevicente
ID: 6965822
I still have the keepAlive is not defined error. Here is the code:

<html>
<head>
<SCRIPT LANGUAGE="JavaScript" >
function keepAlive()
{
           document.write('<img src="https://Dominoserver/icons/image.gif" WIDTH=1 HEIGHT=1>');
           setTimeout('keepAlive()',10000);

}
</head>
<body onLoad="keepAlive();">
Hello
</body>
</html>
0
 

Author Comment

by:perevicente
ID: 6965962
I still have the keepAlive is not defined error. Here is the code:

<html>
<head>
<SCRIPT LANGUAGE="JavaScript" >
function keepAlive()
{
           document.write('<img src="https://Dominoserver/icons/image.gif" WIDTH=1 HEIGHT=1>');
           setTimeout('keepAlive()',10000);

}
</head>
<body onLoad="keepAlive();">
Hello
</body>
</html>
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6966859
OK, this is still not possible by requiring again and again some elements from Domino.
The problem is that when session time is set to 90 minutes and you are requesting after 89 minutes an image and after 91 minutes again, then you get the one after 89 minute. For the next you have to login again. The session time does not count from last request; it ends after designed amount of minutes after the cookie was created at logon time.

To keep alive your timer your window has to stay alive. And you do overwrite the window.

Try this:
<html>
<head>
<SCRIPT LANGUAGE="JavaScript" >
function keepAlive() {
   nw = window.open('','');
   nw. document.write('<img src="https://Dominoserver/icons/image.gif" WIDTH=1 HEIGHT=1>');
   nw.close()
   setTimeout('keepAlive()',3000);
}
</script>
</head>
<body onLoad="keepAlive();">
Hello
</body>
</html>

This is for you to check my 90 minute statement.

For your Domino session problem I already sow a solution on the web, but just now I can not remember where.

Are you allowed to make changes to servers $$LoginUserForm ?



0
 
LVL 10

Accepted Solution

by:
zvonko earned 125 total points
ID: 6966870
Of course! it was in SandBox :-)

Here it is:
http://www.notes.net/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/879a6d45151825cd88256ae3006a7d47?OpenDocument

(not tested by me, but sounds reasonable :-)

0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6967158
You are loosing reference to the script after generating the html doc thorugh script.

like this,

var dt = new Date();
function keepAlive()
{
     window.status = "C = " + dt; // This is for test
     document.write('<HTML> <HEAD>');
     document.write("<SCRIPT Src=\"jspage.js\" Language=\"Javascript\"></Script>");
     document.write('<img src="https://Dominoserver/icons/image.gif" WIDTH=1 HEIGHT=1>');
     document.write('</HEAD> </HTML>');
     setTimeout('keepAlive()',10000);
}
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6968053
Thank you for the points perevicente :-)

Would you please be so kind a drop a line here when you have tested this SandBox code :-)

0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6968054
;-)
0
 

Author Comment

by:perevicente
ID: 6968069
zvonko,

probably I won't test that code because I don't want automatically to prompt user to re-authenticate when the session expires in order not lossing the editing information. My goal it is different and with the js code you explained to me can be enough. If it is not, then maybe I have to find a more deep and difficult solution and perhaps I should try the SandBox code, but not for the moment.

Thank you again for your help.
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6968296
Thank you for the feedback :-)

Exact this way is the way I see this EE community: ExchangeExperience

Cheers,
zvonko
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question