Solved

keep the Domino session alive from a external site

Posted on 2002-04-24
12
707 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
 

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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now