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

Discussion in 'ASP General' started by tdmailbox@yahoo.com, Jan 6, 2008.

  1. Guest

    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=&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"
    %>
     
    , Jan 6, 2008
    #1
    1. Advertising

  2. Guest

    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&login=&password=password&login.x=17&login.y=7">
    </html>


    On Jan 6, 12:12 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere
    dot com> wrote:
    > client side problem
    >
    > use a refresh meta tag
    >
    > http://www.i18nguy.com/markup/metatags.html
     
    , Jan 6, 2008
    #2
    1. Advertising

  3. pt Guest

    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
    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 domain.
     
    pt, Jan 7, 2008
    #3
  4. pt Guest

    On Jan 7, 12:20 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere
    dot com> wrote:
    > 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.
     
    pt, Jan 7, 2008
    #4
  5. pt Guest

    On Jan 7, 3:46 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
    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.
     
    pt, Jan 7, 2008
    #5
  6. "pt" <> wrote in message
    news:...
    On Jan 7, 3:46 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
    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
     
    Anthony Jones, Jan 8, 2008
    #6
  7. Guest

    On Jan 7, 11:13 pm, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere
    dot com> wrote:
    > 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
     
    , Jan 8, 2008
    #7
  8. Guest

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

    On Jan 8, 3:13 am, "Anthony Jones" <> wrote:
    > "pt" <> wrote in message
    >
    > news:...
    > 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 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, 2008
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. So
    Replies:
    1
    Views:
    372
    Mircea Pleteriu
    May 4, 2005
  2. So
    Replies:
    0
    Views:
    471
  3. Cheng Mo
    Replies:
    4
    Views:
    574
    Gianni Mariani
    Dec 2, 2004
  4. =?Utf-8?B?YW1qYWQ=?=

    session varaibles with asp.net urgent help

    =?Utf-8?B?YW1qYWQ=?=, Jul 7, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    2,155
  5. RANNA
    Replies:
    5
    Views:
    275
    CBFalconer
    Nov 10, 2008
Loading...

Share This Page