Solved

keep the Domino session alive from a external site

Posted on 2002-04-24
12
713 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 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