469,646 Members | 1,628 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

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

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************************@mydomain.com&password=m ypassword&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=passw ord&login.x=17&login.y=7"
%>

Jan 6 '08 #1
11 2647
client side problem

use a refresh meta tag

http://www.i18nguy.com/markup/metatags.html
Jan 6 '08 #2
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?
ac*********************@mydomaain.com&password=pas sword&login.x=17&login.y=7">
</html>
On Jan 6, 12:12*pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere
dot comwrote:
client side problem

use a refresh meta tag

http://www.i18nguy.com/markup/metatags.html
Jan 6 '08 #3
the tag has a content value which sets the refresh cycle in seconds.

when your page is refreshed it will refresh the page from the outside domain.

Jan 6 '08 #4
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>


On Jan 6, 3:54*pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
comwrote:
the tag has a content value which sets the refresh cycle in seconds.

when your page is refreshed it will refresh the page from the outside domain.
Jan 7 '08 #5
if the third party page is doing a frame detection you won't be able to defeat that.

Jan 7 '08 #6
pt
On Jan 7, 12:20*pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere
dot comwrote:
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.
Jan 7 '08 #7


"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.


Jan 7 '08 #8
pt
On Jan 7, 3:46*pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
comwrote:
"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.

Jan 7 '08 #9

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


Jan 8 '08 #10

"pt" <ri*************@gmail.comwrote in message
news:7d**********************************@i72g2000 hsd.googlegroups.com...
On Jan 7, 3:46 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
comwrote:
>>
"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.

--
Anthony Jones - MVP ASP/ASP.NET
Jan 8 '08 #11
this worked like a champ..... thanks anthony...

On Jan 8, 3:13*am, "Anthony Jones" <A...@yadayadayada.comwrote:
"pt" <richard.zell...@gmail.comwrote in message

news:7d**********************************@i72g2000 hsd.googlegroups.com...
On Jan 7, 3:46 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dotcom>wrote:
"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 maywant 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.

--
Anthony Jones - MVP ASP/ASP.NET
Jan 8 '08 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Nel | last post: by
4 posts views Thread by Craig Bailey | last post: by
4 posts views Thread by Alan Walkington | last post: by
1 post views Thread by John Ryan | last post: by
8 posts views Thread by Beowulf | last post: by
1 post views Thread by joost | last post: by
2 posts views Thread by sky2070 | last post: by
1 post views Thread by Brian | last post: by
1 post views Thread by Clarice Almeida Hughes | last post: by
2 posts views Thread by Frans Schmidt | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.