Solved

keep the Domino session alive from a external site

Posted on 2002-04-24
12
717 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
  • 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
Independent Software Vendors: 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 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