Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

keep the Domino session alive from a external site

Posted on 2002-04-24
12
Medium Priority
?
732 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 500 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

  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…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

715 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