Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cookie retrieval problems

    Hello

    I am trying to pass some parameters from one web server to another web server with different domains, I know that due to the IE security issue, I can't pass parameter directly, but since I can access to both of the server and do the coding, so I tried the following:

    1) on webserver1 collect the parameters and construct a URL base on the webserver2 like: "http://webserver2/sender.jsp?test1=111,222

    2) when webserver2's sender.jsp onload get the parameters base on the URL and create a cookie named "test1" with values 111,222

    3) on webserver2, create a frame named "Listener" and refresh itself for every 2 sec, if detected the cookie "test1" is not NULL, then forward the value to my desired text field. However I failed. :-<

    Logically when I create a cookie in webserver2 and retrieve the cookie from webserver2, it should be ok, but I don't know why it doesn't work for me, and I tried to set the cookie on the parent frame of listener.jsp, it works fine, and the listener can retrieve the value right after refresh itself. so the cookie setting should have no problem, but don't know why the listener.jsp can't get the cookie which the sender.jsp create, did anyone have any idea? thanxs.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Security issue. A cookie created in one domain cannot be read or retrieved by another domain.

  • #3
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    Thanx for your reply, but I have launch the page in same server and then create the cookie, so it should solved the domains problem, isn't it?

    Server1
    http://www.webserver1.com/

    Server2
    http://www.webserver2.com/

    Steps:
    -------
    a) on Server1 http://www.webserver1.com/createvalue.jsp
    generate the values 111,222
    b) construct the URL http://www.webserver2.com/sender.jsp?id=111,222
    c) window.open http://www.webserver2.com/sender.jsp?id=111,222
    d) http://www.webserver2.com/sender.jsp
    onload -> get id = 111,222
    create cookie "test1" with values 111,222
    e) refresh http://www.webserver2.com/listener.jsp for every 3 sec
    detect if cookie != null, then get value

    From step c), the domain should be on webserver2 not webserver1 anymore, so on step d) for cookie creation, cookie should created in webserver2, and so in step e), I should available to collect the cookie, since they are on the same domain and cookie not expired yet, isn't it??


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •