Re: [PHP] Re: Setting cookie for two domains.

2006-01-06 Thread Jochem Maas

Robert Cummings wrote:

On Fri, 2006-01-06 at 03:48, Jochem Maas wrote:


that is some nice out-of-the-box thinking Mark!



*lol* This technique has been floating around for years :) There should
be references in the archives.


not on my planet ;-)



Cheers,
Rob.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Setting cookie for two domains.

2006-01-06 Thread Robert Cummings
On Fri, 2006-01-06 at 03:48, Jochem Maas wrote:
> that is some nice out-of-the-box thinking Mark!

*lol* This technique has been floating around for years :) There should
be references in the archives.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Setting cookie for two domains.

2006-01-06 Thread Jochem Maas

that is some nice out-of-the-box thinking Mark!

Mark wrote:

Shafiq Rehman wrote:



Hi,

How can I register a session or cookie for two domains. I want to maintain
logged user's state when he goes from one domain to other domain.

Example
Suppose a user is logged in on domain1.com. A cookie is set and user is
authenticated from database on the basis of that cookie. When he goes from
domain1.com to domain2.com, I want he remains loggedin on domain2.com. I
do not want any query string. Is it possible by playing with cookie or
session settings?

Please advise if anybody has faced such problem.



I have been giving this problem some more thought and I think I have an
answer for you. My previous response was pretty invasive if you don't have
full control or knowledge of the web session code.

Assuming you index by some session ID, and that ID can be shared across
sites.

You make a graphical bug or link.

On both servers you create a PHP file that accepts a URL parameter, sets a
cookie, and displays an image. Something like:



mylogo.php





Now in BOTH websites, render an image on your page as:

site 1:
http://www.site2.org/mylogo.php?phpsession=hddfewfelkfjewlkewflkjlkweweio";>

site 2:
http://www.site1.org/mylogo.php?phpsession=hddfewfelkfjewlkewflkjlkweweio";>


This way, you pass the cookie to both sites.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Setting cookie for two domains.

2006-01-05 Thread Shafiq Rehman
Hello Guys,

Thanx a lot for sharing some really great ideas. especial Mark and Albert
has suggested some great stuff to do.

Thanx a lot.
--
*** phpgurru.com [A php resource provider] ***

\\\|///
  \\  - -  //
   (  @ @  )   PHP is too logical for my brain
+---oOOo-(_)-oOOo--+
|Mian Shafiq ur Rehman
|phpgurru.com [A php resource provider]
|107 B, New Town, Multan Road
|Lahore Pakistan
|
| Mobile:0300 423 9385
|
|   ooo0 http://www.phpgurru.com
|  ()   0ooo E-Mail: [EMAIL PROTECTED]
+---\  ((   )--+
  \_)) /
 (_/


[PHP] Re: Setting cookie for two domains.

2006-01-05 Thread Mark
Shafiq Rehman wrote:

> Hi,
> 
> How can I register a session or cookie for two domains. I want to maintain
> logged user's state when he goes from one domain to other domain.
> 
> Example
> Suppose a user is logged in on domain1.com. A cookie is set and user is
> authenticated from database on the basis of that cookie. When he goes from
> domain1.com to domain2.com, I want he remains loggedin on domain2.com. I
> do not want any query string. Is it possible by playing with cookie or
> session settings?
> 
> Please advise if anybody has faced such problem.

I have been giving this problem some more thought and I think I have an
answer for you. My previous response was pretty invasive if you don't have
full control or knowledge of the web session code.

Assuming you index by some session ID, and that ID can be shared across
sites.

You make a graphical bug or link.

On both servers you create a PHP file that accepts a URL parameter, sets a
cookie, and displays an image. Something like:

>>> mylogo.php



Now in BOTH websites, render an image on your page as:

site 1:
http://www.site2.org/mylogo.php?phpsession=hddfewfelkfjewlkewflkjlkweweio";>

site 2:
http://www.site1.org/mylogo.php?phpsession=hddfewfelkfjewlkewflkjlkweweio";>


This way, you pass the cookie to both sites.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Setting cookie for two domains.

2006-01-05 Thread Al

Shafiq Rehman wrote:

Hi,

How can I register a session or cookie for two domains. I want to maintain
logged user's state when he goes from one domain to other domain.

Example
Suppose a user is logged in on domain1.com. A cookie is set and user is
authenticated from database on the basis of that cookie. When he goes from
domain1.com to domain2.com, I want he remains loggedin on domain2.com. I do
not want any query string. Is it possible by playing with cookie or session
settings?

Please advise if anybody has faced such problem.

Regards
http://www.phpgurru.com




Why not simply save the session ID in the first site in your DB or a temp file.  Then have the second site query for it 
via ftp or for a file fopen.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Setting cookie for two domains.

2006-01-05 Thread Mark
Shafiq Rehman wrote:

> Hi,
> 
> How can I register a session or cookie for two domains. I want to maintain
> logged user's state when he goes from one domain to other domain.
> 
> Example
> Suppose a user is logged in on domain1.com. A cookie is set and user is
> authenticated from database on the basis of that cookie. When he goes from
> domain1.com to domain2.com, I want he remains loggedin on domain2.com. I
> do not want any query string. Is it possible by playing with cookie or
> session settings?
> 
> Please advise if anybody has faced such problem.

I don't know exactly what you are looking for, but if you have control over
the URLs of both domain 1 and 2, you can use the session ID as a URL
parameter and do something like this:

$sid = $_GET['phpsessionid'];

if(!$sid)
 # check cookie and continue as normal
else
 # use $sid as your session ID  

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php