passing information between webpages using cookie

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Song Zhang

    passing information between webpages using cookie

    I have two webpage, one is http://appA.mycompany.com/first.html and the
    other is http://appB.mycompany.com/second.html

    When a user visits first.html, he may click a button A, which launches
    second.html. In second.html, there is a button, if clicked, a cookie is set
    with “mycookie=ok;do main=.mycompany .com”.

    At first.html, I have a function that keeps checking cookie with name
    mycookie. If mycookie is set, an alert window is started to show the value
    of mycookie.

    My question is principally, is this doable? Thx in advance.

    _______________ _______________ _______________ _______________ _____
    Instant message with integrated webcam using MSN Messenger 6.0. Try it now
    FREE! http://msnmessenger-download.com

  • Lasse Reichstein Nielsen

    #2
    Re: passing information between webpages using cookie

    "Song Zhang" <sozst1@hotmail .com> writes:
    [color=blue]
    > I have two webpage, one is http://appA.mycompany.com/first.html and
    > the other is http://appB.mycompany.com/second.html[/color]
    ....[color=blue]
    > In second.html, there is a button, if clicked, a cookie is set with
    > “mycookie=ok;do main=.mycompany .com”.[/color]
    [color=blue]
    > At first.html, I have a function that keeps checking cookie with name
    > mycookie.[/color]
    ....[color=blue]
    > My question is principally, is this doable? Thx in advance.[/color]

    Technically, yes. However, it only works if the user's browser allows
    cross-domain cookies, and not all browsers (or users) do that.

    It is, however, probably your only chance of communicating between
    pages in different domains.

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • MikeB

      #3
      Re: passing information between webpages using cookie

      How about if you use a HTA as your host and open each page in its own frame? I haven't done exactly
      what the OP is asking, but similar to what I am describing. When you open each page, set a handle
      to the window and just use a variable and I suppose a timer in the HTA to keep checking for a change
      in the value of the variable.


      "Lasse Reichstein Nielsen" <lrn@hotpop.com > wrote in message news:y8wa58lc.f sf@hotpop.com.. .[color=blue]
      > "Song Zhang" <sozst1@hotmail .com> writes:
      >[color=green]
      > > I have two webpage, one is http://appA.mycompany.com/first.html and
      > > the other is http://appB.mycompany.com/second.html[/color]
      > ...[color=green]
      > > In second.html, there is a button, if clicked, a cookie is set with
      > > "mycookie=ok;do main=.mycompany .com".[/color]
      >[color=green]
      > > At first.html, I have a function that keeps checking cookie with name
      > > mycookie.[/color]
      > ...[color=green]
      > > My question is principally, is this doable? Thx in advance.[/color]
      >
      > Technically, yes. However, it only works if the user's browser allows
      > cross-domain cookies, and not all browsers (or users) do that.
      >
      > It is, however, probably your only chance of communicating between
      > pages in different domains.
      >
      > /L
      > --
      > Lasse Reichstein Nielsen - lrn@hotpop.com
      > Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
      > 'Faith without judgement merely degrades the spirit divine.'[/color]


      Comment

      • Bryan Field-Elliot

        #4
        Re: passing information between webpages using cookie

        This is not really a cross-domain cookie, it's a domain-wide cookie.
        Most browsers allow this by default. What Song is proposing will work,
        if he can write the Javascript timer code appropriately in first.html
        (e.g. go to sleep for 1 second, try reading the cookie, etc.).


        --

        Bryan Field-Elliot





        Lasse Reichstein Nielsen wrote:[color=blue]
        > "Song Zhang" <sozst1@hotmail .com> writes:
        >
        >[color=green]
        >>I have two webpage, one is http://appA.mycompany.com/first.html and
        >>the other is http://appB.mycompany.com/second.html[/color]
        >
        > ...
        >[color=green]
        >>In second.html, there is a button, if clicked, a cookie is set with
        >>“mycookie=ok; domain=.mycompa ny.com”.[/color]
        >
        >[color=green]
        >>At first.html, I have a function that keeps checking cookie with name
        >>mycookie.[/color]
        >
        > ...
        >[color=green]
        >>My question is principally, is this doable? Thx in advance.[/color]
        >
        >
        > Technically, yes. However, it only works if the user's browser allows
        > cross-domain cookies, and not all browsers (or users) do that.
        >
        > It is, however, probably your only chance of communicating between
        > pages in different domains.
        >
        > /L[/color]

        Comment

        Working...