Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 8th, 2004, 02:51 AM
Registered User
 
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default get cookie info from other domain using fsockopen


I'm trying to retrieve a cookie set in one domain (1) from another (2) using fsockopen, I think this is possible doing the next tips:
       1. in the domain 1 where I set the cookie I created a script (getcookie.php) which I retrieve cookie info.
       2. in the domain 2 I have a script (getcookieFromServer.php) where I use fsockopen to get the cookie content from domain 1 with the first script.

       I think this is possible and I'm working on this. My question is if this way is correct and if there is somebody can have a solution better.

       greetings to all.
       (sorry, this is my poor english, great eh!...)

 
Old September 8th, 2004, 03:08 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I don't think what your trying to do is possible. Cookies are sent by browsers and at that are only sent to the domain name listed as creator of the cookie, so how can you get one from a socket connection?

If you could get a cookie from a simple socket connection that would constitute a major security threat, consider being able to get usernames and passwords from unsuspecting users by copying all of their cookies through a backdoor socket.

So having said that, I think you may be confusing the terminology. Can you rephrase your question and try and be more specific about what you're trying to do?

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
 
Old September 8th, 2004, 06:26 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Thinking on this a little more..

Are you setting up a robot application that accesses websites, where you want to read the contents of the cookie sent from the website? In which case, I'm not sure we can be of help without seeing some code. Please post some relevant snips of code.

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail





Similar Threads
Thread Thread Starter Forum Replies Last Post
Same pages for sub domain from main domain vivek_inos ASP.NET 1.0 and 1.1 Professional 1 February 13th, 2007 10:15 AM
A challenge: getting domain info with ASP Steve777 Classic ASP Professional 22 September 30th, 2006 07:28 AM
UPS servlet interaction with XML via PHP fsockopen karateka Pro PHP 2 October 20th, 2004 12:24 PM
fsockopen ssl failure: why? donh BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 September 16th, 2004 05:21 PM
http://domain or http://www.domain anshul HTML Code Clinic 9 August 11th, 2004 01:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.