[PHP] Re: Setting cookies for other domains

2005-03-19 Thread Raj Shekhar
Scott Haneda [EMAIL PROTECTED] writes:

 Cross domain cookies are indeed possible, look at microsoft.com, msn.com and
 msnbc.com which indeed do share your cookies from one site to the next,
 however, they do it by redirects and get/post methods, which is perfectly
 legit since they control those domains.  No one outside someone with access
 to those servers could implement it.

I might be wrong on this analysis, but here is how I think the MSN
thing works

- When you go to hotmail.com, it redirects you to login.passport.com

- If you do not have your cookie (from the passport.com domain), which
  identifies you as a valid MSN network user, you are asked to sign
  in.  After successful sign on, your browser gets a passport cookie.

- The passport now redirects you to the hotmail.com and it passes your
  user information using the url.  I think it passes some sort of
  session id.  Since in the background, passport and hotmail share the
  same database, hotmail can check on a user's authentication based on
  the session id passed in the URL.  

- The same thing happens when you go to msnbc.com.  You are first
  redirected to passport.com and your passport.com's cookie is
  examined.

Thus, even though you think that msn, hotmail and msnbc are sharing
the same cookie, they are not.  It is the passport.com that is doing
the dirty work of setting and examining the cookie.

-- 
Raj Shekhar  Y!   : Operations Engineer
MySQL DBA, programmer and  slacker   Y!IM : lunatech3007
home : http://rajshekhar.net blog : http://rajshekhar.net/blog/

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



[PHP] Re: Setting Cookies in netscape and explorer?

2002-06-21 Thread Kondwani Spike Mkandawire


Martin Johansson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi!
Cookies makes me go AGHH!!
Please help me with this:

I am setting a cookie like this in my loginscript:

setcookie(devProcCookie, cookie value.|.time(), 31536000); // Set
cookie
header(Location: inside.php);
exit;

So far it works!
But when I go to the inside.php page that looks like this:

$cookie_life = 30;
// The cookie lives for 1 hour
$tok = explode(|, $HTTP_COOKIE_VARS[devProcCookie]);
$cookie_value = $tok[0];
$creation_time = $tok[1];
if((time()-$creation_time)  $cookie_life)
// If time expires go to cookie_expired.php
{
// cookie has expired so delete it.
setcookie(devProcCookie, );
header (Location: cookie_expired.php);
exit;
}
setcookie(devProcCookie, cookie value.|.time(), 31536000); // If
time hasnt expired update the cookie time


Something happens in netscape. Everything works fine in IExplorer.
Netscape says:

Notice: Undefined index: devProcCookie in
c:\inetpub\wwwroot\devproc\beta\inside.php on line 2
Notice: Undefined offset: 1 in c:\inetpub\wwwroot\devproc\beta\inside.php on
line 4
Warning: Cannot add header information - headers already sent by (output
started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in
c:\inetpub\wwwroot\devproc\beta\inside.php on line 9
Warning: Cannot add header information - headers already sent by (output
started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in
c:\inetpub\wwwroot\devproc\beta\inside.php on line 10

What is wrong!
Please help me someone!!!
/Martin



---
Ditt utgående mail är virusfritt.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.371 / Virus Database: 206 - Release Date: 2002-06-13




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




[PHP] Re: Setting Cookies in netscape and explorer?

2002-06-21 Thread Kondwani Spike Mkandawire

As opposed to using the Cookies Array HTTP_COOKIES_VAR
could you not just use explode the $devProcCookie using
if (isset($devProcCookie)){
$tok = explode(|, $devProcCookie);
}
//Note this will only work if the global variables in your php.ini files
are turned on...
I have no idea why it can't read the index $devProcCookie in the
Cookies Array if you figure it out though please post up...

Kondwani


Martin Johansson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi!
Cookies makes me go AGHH!!
Please help me with this:

I am setting a cookie like this in my loginscript:

setcookie(devProcCookie, cookie value.|.time(), 31536000); // Set
cookie
header(Location: inside.php);
exit;

So far it works!
But when I go to the inside.php page that looks like this:

$cookie_life = 30;
// The cookie lives for 1 hour
$tok = explode(|, $HTTP_COOKIE_VARS[devProcCookie]);
$cookie_value = $tok[0];
$creation_time = $tok[1];
if((time()-$creation_time)  $cookie_life)
// If time expires go to cookie_expired.php
{
// cookie has expired so delete it.
setcookie(devProcCookie, );
header (Location: cookie_expired.php);
exit;
}
setcookie(devProcCookie, cookie value.|.time(), 31536000); // If
time hasnt expired update the cookie time


Something happens in netscape. Everything works fine in IExplorer.
Netscape says:

Notice: Undefined index: devProcCookie in
c:\inetpub\wwwroot\devproc\beta\inside.php on line 2
Notice: Undefined offset: 1 in c:\inetpub\wwwroot\devproc\beta\inside.php on
line 4
Warning: Cannot add header information - headers already sent by (output
started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in
c:\inetpub\wwwroot\devproc\beta\inside.php on line 9
Warning: Cannot add header information - headers already sent by (output
started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in
c:\inetpub\wwwroot\devproc\beta\inside.php on line 10

What is wrong!
Please help me someone!!!
/Martin



---
Ditt utgående mail är virusfritt.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.371 / Virus Database: 206 - Release Date: 2002-06-13




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




[PHP] Re: Setting Cookies in netscape and explorer?

2002-06-21 Thread Martin Johansson

I tried your stuff but it didnt help me!
Still works in explorer but when I tried it in netscape
It says ERROR!!! in netscape

if (isset($devProcTailorCookie))
{
$tok = explode(|, $devProcTailorCookie);
}
else
{
echo ERRROR!!!;
}

I have global_variables turned on in my php.ini
/Martin



Kondwani Spike Mkandawire [EMAIL PROTECTED] skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 As opposed to using the Cookies Array HTTP_COOKIES_VAR
 could you not just use explode the $devProcCookie using
 if (isset($devProcCookie)){
 $tok = explode(|, $devProcCookie);
 }
 //Note this will only work if the global variables in your php.ini files
 are turned on...
 I have no idea why it can't read the index $devProcCookie in the
 Cookies Array if you figure it out though please post up...

 Kondwani


 Martin Johansson [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi!
 Cookies makes me go AGHH!!
 Please help me with this:

 I am setting a cookie like this in my loginscript:

 setcookie(devProcCookie, cookie value.|.time(), 31536000); //
Set
 cookie
 header(Location: inside.php);
 exit;

 So far it works!
 But when I go to the inside.php page that looks like this:

 $cookie_life = 30;
 // The cookie lives for 1 hour
 $tok = explode(|, $HTTP_COOKIE_VARS[devProcCookie]);
 $cookie_value = $tok[0];
 $creation_time = $tok[1];
 if((time()-$creation_time)  $cookie_life)
 // If time expires go to cookie_expired.php
 {
 // cookie has expired so delete it.
 setcookie(devProcCookie, );
 header (Location: cookie_expired.php);
 exit;
 }
 setcookie(devProcCookie, cookie value.|.time(), 31536000); // If
 time hasnt expired update the cookie time


 Something happens in netscape. Everything works fine in IExplorer.
 Netscape says:

 Notice: Undefined index: devProcCookie in
 c:\inetpub\wwwroot\devproc\beta\inside.php on line 2
 Notice: Undefined offset: 1 in c:\inetpub\wwwroot\devproc\beta\inside.php
on
 line 4
 Warning: Cannot add header information - headers already sent by (output
 started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in
 c:\inetpub\wwwroot\devproc\beta\inside.php on line 9
 Warning: Cannot add header information - headers already sent by (output
 started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in
 c:\inetpub\wwwroot\devproc\beta\inside.php on line 10

 What is wrong!
 Please help me someone!!!
 /Martin



 ---
 Ditt utgående mail är virusfritt.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.371 / Virus Database: 206 - Release Date: 2002-06-13






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




[PHP] Re: Setting Cookies in netscape and explorer?

2002-06-21 Thread Martin Johansson

Another thing!

when I look in netscape/preferences/privacysecurity/cookies/view Stored
Cookies..
there is no cookie for my website.. isnt that strange?
/Martin



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




[PHP] Re: Setting Cookies in netscape and explorer?

2002-06-21 Thread Martin Johansson

Yes!!! I got it to work!

The problem was the expirationdate in the cookie:
setcookie(devProcTailorCookie, cookie value.|.time(), 31536000);

Now I set it like this:
setcookie(devProcTailorCookie, cookie value.|.time(), time()+10);

But now it doesnt work in explorer. But I would be able to fix that.
Thanks
/Martin



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




[PHP] Re: Setting Cookies

2002-06-10 Thread Craig Donnelly

http://www.php.net/manual/en/reserved.variables.php#reserved.variables.cooki
es

Use Superglobals...you will see what I mean.

Also, Apache 2.0 is not recommended as of yet for PHP commercial development
http://www.apacheweek.com/issues/02-06-07

Regards,

Craig

Scott 'Intense!' Reismanis [EMAIL PROTECTED] wrote in message
01c20e9f$c8720620$850d2dcb@intense">news:01c20e9f$c8720620$850d2dcb@intense...
 Hey all,

 I am having some troubles setting cookies at the moment wondering if
 anyone knows the solution.

 Anyhow basically what is happening, is that cookies are been set fine,
 however say I try to set two cookies in the one script

 i.e.
 setcookie(username, $HTTP_POST_VARS['username'], time()+31536000);
 setcookie(password, $HTTP_POST_VARS['password'], time()+31536000);

 only the cookie that was called last, i.e. 'password' will be set. I
 only started noticing this problem since I installed php4.2 and
 apache2.0, is that the cause? Has anyone shared a similar experience,
 and if so is there a fix? Thanks for your time as always.

 Regards,


Scott




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




[PHP] Re: Setting Cookies

2001-12-10 Thread Jeremy Reed

You are getting that error because you have sent output to the browser
BEFORE you try to set the cookie information.  When dealing with cookies, it
is important to do all processing before sending any output to the browser.

Jeremy Reed

Steve Osborne [EMAIL PROTECTED] wrote in message
002b01c181b2$52343700$[EMAIL PROTECTED]">news:002b01c181b2$52343700$[EMAIL PROTECTED]...
 I am attempting to use the SetCookie command.  I receive the following
 error:

 Warning: Cannot add header information - headers already sent by
 (reference to current page)...

 At this point I have authenticated the user, and am trying to set the
cookie
 before redirecting them to the registered users section.  Should I be
 setting the cookie on the top of the page that I am sending them to?

 Any comments or suggestions would be greatly appreciated.

 Steve Osborne
 [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]