ASP to re-load page from time to time to reset varaibles

T

tdmailbox

I have a website that I subscribe to that allows me to track tasks. I
have an extra computer with a big monitor that i want to always
display the task list. the problem is after so many hours I get
logged out.

I need to need to reload that sign in url every few hours

If I load this url it logs me and resets my session variable and
redirects me
http://www.taskmaster.com/tc?action....com&password=mypassword&login.x=17&login.y=7"


What i ended up doing was making a webpage on my webserver that
automaticly redirects to the page

I have a webpage http://www.mydomain.com/reload.asp that has the code
below.

But if there a way I can change that code on my page so that it just
loads the page in the background and doesnt redirect? that way I can
then modify my page to automaticly refresh every few hours to reset
the cookie/session variable.

<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.taskmaster.com/tc?
action=Login&login=rich@mydomaincom&password=password&login.x=17&login.y=7"
%>
 
T

tdmailbox

that code seems to just work as a redirect, but it just redirects you
once. that is what I was playing with before I came here

what i need is a page on my domain which goes out and loads another on
someone elses domain page every hour. But it needs to stay on the
page in my domain so that one hour later it can reload the other guys
page ...

I thought I had a solution by using frames. I stuck the third party
website in a frame but that seems cause the third party site to fail.
it gives an error that i have already logged in on another window. so
frames doesnt seem to work.. that is my core problem. If I could get
it to work in a frame then I could put a reload on the parent frame.

I built a page taskmaster_con.asp which has teh redirect code it in..
works lke a champ when I call it directly however when I stick it in a
frame the website I acm
What I tried to do was stick taskmaster_con.asp into a frame (whatway
I could refresh the master frame which would then load this login page
in a child window)
However when I run it from a frame the login fails with a message
about me loggingin through another browser window.


which has
<html>
<meta http-equiv="Refresh" content="0; url=http://www.taskmaster.com/
tc?
action=Login&[email protected]&password=password&login.x=17&login.y=7">
</html>
 
P

pt

That code does a redirect... so even if I set my page to reload every
30 seconds, the first time it reloads it does the redirect and then
that is it..

I thought maybe I could stick this page into a frame and add a timer
to that. I built a fram page with a single frame however when I run
that page the 3rd party website gives me an error
'Your session is invalid. It has either timed out or you have logged
into your account from another browser window.'

It somehow knows I am loading this page from a frame.. I know this
because if i load taskmaster_con.asp directly I get logged in by the
third party website.

If there any change I can make to the frames that would keep the third
party website from being able to tell I am loading this into a frame?
I think that is my core problem now.

<html>
<frameset >
<frame src="taskmastter_con.asp">

</frameset>
</html>
 
P

pt

if the third party page is doing a frame detection you won't be able to defeat that.

What about another command that I could run that would 'load' the
other page. I dont need to even see the other page. I am looking now
to see if there is a way to just load the other page into memory the
set cookies and/or session variables.
 
P

pt

"What about another command that I could run that would 'load' the
other page.  I dont need to even see the other page.   I am looking now
to see if there is a way to just load the other page into memory the
set cookies and/or session variables."

I'm not really sure I understand what you are trying to accomplish here.  If you're tryting to get content from another site you may
want to look into something called screen - scraping .  Check it out on google.

I am not looking to get content from the page.. The URL I submit logs
me in and resets my cookie.. every 5 hours I want to re-login. I dont
need to submit a form since the login info is in the url. I just want
to load a page so that it resets my cookie.

I want to load the same 3rd party webpage every 5 hours. When I do a
response redirect I get directed there once, end of story.. When I
stick the 3rd party inside a fram and reload the parent frame the 3rd
party site doesnt like that.
 
A

Anthony Jones

"What about another command that I could run that would 'load' the
other page. I dont need to even see the other page. I am looking now
to see if there is a way to just load the other page into memory the
set cookies and/or session variables."

I'm not really sure I understand what you are trying to accomplish here.
If you're tryting to get content from another site you may
want to look into something called screen - scraping . Check it out on
google.

I am not looking to get content from the page.. The URL I submit logs
me in and resets my cookie.. every 5 hours I want to re-login. I dont
need to submit a form since the login info is in the url. I just want
to load a page so that it resets my cookie.

I want to load the same 3rd party webpage every 5 hours. When I do a
response redirect I get directed there once, end of story.. When I
stick the 3rd party inside a fram and reload the parent frame the 3rd
party site doesnt like that.
<<

Sounds to me that you don't actually need the content of the page you just
want send the request for the page to keep a login alive.

You need chunk of clientside Javascript:-


var xhr = GetXMLHttpRequest()
if (xhr)
{
xhr.Open("GET", sURL, false)
xhr.Send(null)
}


function GetXMLHttpRequest()
{

if (window.XMLHttpRequest) {
return new XMLHttpRequest()
} else if (window.ActiveXObject) {
return new ActiveXObject("MSXML2.XMLHTTP.3.0")
}

}

Where sURL is the login url you want to hit.
 
T

tdmailbox

I don't know what this means:

 "the 3rd party site doesn't like that"

This is an ASP newsgroup. We can help you solve an ASP question. We can't help you with things that third party pages like or don't
like

first off, i am very greatfull for the help. my original request
was to reload a page at regular intervals via .asp. the trick being
that the page i want to reload is not the page that i can put the code
on.. the suggestions that you gave was some stuff that I already
tried.

at this point I am still looking for some advice to solve the same
problem.. a block of asp code that will reload a page (a differnt
page from the code resides on) at regular intervals.


my only point about the 3rd party website not liking something was
that I cant use a solution based on frames.

my search now leads me to asp code that might load a page into a
varible like you would use for screen scrape. the code can throw away
the loaded text as long as I get my session varables set.

I am going to check out Anthony's code... thanks all
 
T

tdmailbox

this worked like a champ..... thanks anthony...

If you're tryting to get content from another site you may> want to look into something called screen - scraping . Check it out on

google.

I am not looking to get content from the page.. The URL I submit logs
me in and resets my cookie.. every 5 hours I want to re-login.  I dont
need to submit a form since the login info is in the url.  I just want
to load a page so that it resets my cookie.

I want to load the same 3rd party webpage every 5 hours.  When I do a
response redirect I get directed there once, end of story..  When I
stick the 3rd party inside a fram and reload the parent frame the 3rd
party site doesnt like that.
<<

Sounds to me that you don't actually need the content of the page you just
want send the request for the page to keep a login alive.

You need chunk of clientside Javascript:-

var xhr = GetXMLHttpRequest()
if (xhr)
{
    xhr.Open("GET", sURL, false)
    xhr.Send(null)

}

function GetXMLHttpRequest()
{

if (window.XMLHttpRequest)  {
    return new XMLHttpRequest()} else if (window.ActiveXObject) {

    return new ActiveXObject("MSXML2.XMLHTTP.3.0")

}
}

Where sURL is the login url you want to hit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top