Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help passing Cookie value from script to Browser

Status
Not open for further replies.

dougconran

Technical User
Sep 26, 2003
89
GB
I need to automate a login (with the site's permission!) to a menu page, drill down from that menu page to a detail page and display that page on a user's browser. The detail page then has links to further information on the same server that the user may wish to access.

I've managed to get as far as logging in, drilling down to the detail page and displaying that but when the user clicks on a link in that page he is returned to the login page.

I know that the site controls access using cookies which, effectively, track a session id through the various accesses.

What I need to be able to do is to pass the cookie that I got when the application logged on over to the browser, presumeably at the time that the retrieved detail HTML page is printed to STDOUT.

I can't work out how to do that (so far).

Although the links are relative urls in the original page I convert them to a full url so that is not hte problem.

Can anyone help?

TIA

Doug
 
it could also be a HTTP_REFERER thing
--Paul

cigless ...
 
Thanks for the suggestion but I've just discovered what it is.

The problem is to do with a security feature of cookies. A cookie is only valid between to specified computers, the one sending the cookie and the one storing it.

In my case my script, running on computer A, gets a page from computer B, thus the cookie is valid between A & B. when I then pass that page on to computer C (the PC with the browser) and embed the cookie in that page it is then valid between computer A and computer C.

When the user drills down to a new page on computer B he can't send the cookie because that is valid only between A & C [sad]

What I need to be able to do is to make the browser on C think that the cookie came from B (but I don't think this is possible).

Any ideas anyone?

TIA

Doug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top