1

PHPでCookieを削除できるかどうか、つまり、特定のサブドメインを別のサブドメインから過去のある時点に再設定できるかどうか疑問に思いました。

例えば:

one.myserver.comで次のコードを実行しているとしましょう。これはtwo.myserver.comのCookieを削除するためのものです。

setcookie("ACOOKIE", 0, time() - 3600, "/", "two.myserver.com");

現在、この方法でそれを行うことは私にとってはうまくいきません。このようなものを機能させる方法はありますか?

4

3 に答える 3

4

Nope, you can only do that from the other subdomain.

于 2011-06-29T18:31:36.763 に答える
2

You dont even know that they exist because they will only be sent(by the client browser) while accessing the domain where they were originally meant for.

于 2011-06-29T18:31:39.907 に答える
1

Not possible. Cookies can only be set and unset from the same fully qualified domain.

于 2011-06-29T18:32:49.193 に答える