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

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

am 06.01.2008 18:03:55 von 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=Login&login=rich@mydomai n.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"
%>

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

am 06.01.2008 18:12:56 von Jon Paal

client side problem

use a refresh meta tag

http://www.i18nguy.com/markup/metatags.html

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

am 06.01.2008 21:19:44 von 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


tc?
action=3DLogin&login=3Drich@mydomaain.com&password=3Dpasswor d&login.x=3D17&l=
ogin.y=3D7">



On Jan 6, 12:12=A0pm, "Jon Paal [MSMD]" dot com> wrote:
> client side problem
>
> use a refresh meta tag
>
> http://www.i18nguy.com/markup/metatags.html

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

am 06.01.2008 21:54:51 von Jon Paal

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.

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

am 07.01.2008 17:06:42 von 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.











On Jan 6, 3:54=A0pm, "Jon Paal [MSMD]" com> wrote:
> 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 doma=
in.

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

am 07.01.2008 18:20:14 von Jon Paal

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

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

am 07.01.2008 21:35:14 von PT

On Jan 7, 12:20=A0pm, "Jon Paal [MSMD]" dot com> wrote:
> if the third party page is doing a frame detection you won't be able to de=
feat 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.

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

am 07.01.2008 21:46:49 von Jon Paal

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

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

am 07.01.2008 22:50:14 von PT

On Jan 7, 3:46=A0pm, "Jon Paal [MSMD]" com> wrote:
> "What about another command that I could run that would 'load' the
> other page. =A0I dont need to even see the other page. =A0 I am looking no=
w
> 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. =
=A0If you're tryting to get content from another site you may
> want to look into something called screen - scraping . =A0Check 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.

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

am 08.01.2008 05:13:13 von Jon Paal

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

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

am 08.01.2008 09:13:58 von Anthony Jones

"pt" wrote in message
news:7d1728a1-e2a7-40d8-bce9-919e87663f89@i72g2000hsd.google groups.com...
On Jan 7, 3:46 pm, "Jon Paal [MSMD]" com> 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 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

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

am 08.01.2008 12:37:58 von tdmailbox

On Jan 7, 11:13=A0pm, "Jon Paal [MSMD]" dot com> wrote:
> I don't know what this means:
>
> =A0"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

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

am 08.01.2008 23:01:06 von tdmailbox

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

On Jan 8, 3:13=A0am, "Anthony Jones" wrote:
> "pt" wrote in message
>
> news:7d1728a1-e2a7-40d8-bce9-919e87663f89@i72g2000hsd.google groups.com...
> On Jan 7, 3:46 pm, "Jon Paal [MSMD]" =
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 may> want to look i=
nto 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. =A0I dont
> need to submit a form since the login info is in the url. =A0I just want
> to load a page so that it resets my cookie.
>
> I want to load the same 3rd party webpage every 5 hours. =A0When I do a
> response redirect I get directed there once, end of story.. =A0When 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 =3D GetXMLHttpRequest()
> if (xhr)
> {
> =A0 =A0 xhr.Open("GET", sURL, false)
> =A0 =A0 xhr.Send(null)
>
> }
>
> function GetXMLHttpRequest()
> {
>
> if (window.XMLHttpRequest) =A0{
> =A0 =A0 return new XMLHttpRequest()} else if (window.ActiveXObject) {
>
> =A0 =A0 return new ActiveXObject("MSXML2.XMLHTTP.3.0")
>
> }
> }
>
> Where sURL is the login url you want to hit.
>
> --
> Anthony Jones - MVP ASP/ASP.NET