Hi,<br>
<br>
Yes, I was hoping that I've made a mistake there, but the thing is, I set up Apache in my computer so that I can access the PHP code on<br>
<br>
sin.my.office.com:80/login.php<br>
while the catalyst works on sin.my.office.com:3000<br>
<br>
So there should be only one domain there, right ?<br>
<br>
This is the HTTP response after setting:<br>
----------------------------<br>
Response Headers<br>
Connection&nbsp; close<br>
Date&nbsp; Tue, 03 Jun 2008 01:58:48 GMT<br>
Content-Length&nbsp; 3163<br>
Content-Type&nbsp; text/html; charset=utf-8<br>
Set-Cookie&nbsp; cookietest_session=2344e9c2e0defb3d1af1a4baec9d8b202adfc35e; path=/; expires=Tue, 03-Jun-2008 03:58:48 GMT<br>
Status&nbsp; 200<br>
X-Catalyst&nbsp; 5.7013<br>
Request Headers<br>
Host&nbsp; sin.my.office.com:3000<br>
User-Agent&nbsp; Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14<br>
Accept&nbsp; text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5<br>
Accept-Language en-us,en;q=0.5<br>
Accept-Encoding gzip,deflate<br>
Accept-Charset&nbsp; ISO-8859-1,utf-8;q=0.7,*;q=0.7<br>
Keep-Alive&nbsp; 300<br>
Connection&nbsp; keep-alive<br>
Referer http://sin.my.office.com:3000/<br>
Cookie&nbsp; __utmz=175737056.1211863250.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); __utma=175737056.1376894921.1211863250.1211959260.1212401921.8; id=sindharta; session=4alqcz3qqey2wkiokonx; cookietest_session=2344e9c2e0defb3d1af1a4baec9d8b202adfc35e; testcookie=iamatestcookiemonster<br>
----------------------------<br>
 <br>
And this is after deleting. Note that I've added <br>
&nbsp;&nbsp;&nbsp; $c-&gt;response-&gt;cookies-&gt;{id} = {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value =&gt; [],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; expires =&gt; time-86400,<br>
&nbsp;&nbsp;&nbsp; };<br>
in Root/del but the id still doesn't get deleted although testcookie does get deleted.<br>
<br>
---------------------<br>
Response Headers<br>
Connection&nbsp; close<br>
Date&nbsp; Tue, 03 Jun 2008 01:59:14 GMT<br>
Content-Length&nbsp; 2790<br>
Content-Type&nbsp; text/html; charset=utf-8<br>
Set-Cookie&nbsp; cookietest_session=2344e9c2e0defb3d1af1a4baec9d8b202adfc35e; path=/; expires=Tue, 03-Jun-2008 03:59:14 GMT<br>
Status&nbsp; 200<br>
X-Catalyst&nbsp; 5.7013<br>
Request Headers<br>
Host&nbsp; sin.my.office.com:3000<br>
User-Agent&nbsp; Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14<br>
Accept&nbsp; text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5<br>
Accept-Language en-us,en;q=0.5<br>
Accept-Encoding gzip,deflate<br>
Accept-Charset&nbsp; ISO-8859-1,utf-8;q=0.7,*;q=0.7<br>
Keep-Alive&nbsp; 300<br>
Connection&nbsp; keep-alive<br>
Referer http://sin.my.office.com:3000/<br>
Cookie&nbsp; __utmz=175737056.1211863250.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); __utma=175737056.1376894921.1211863250.1211959260.1212401921.8; id=sindharta; session=4alqcz3qqey2wkiokonx; cookietest_session=2344e9c2e0defb3d1af1a4baec9d8b202adfc35e<br>
------------------------<br>
<br>
Sindharta<br>
<br>
<br>
<b>Mitch Jackson &lt;perimus@gmail.com&gt;</b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> &gt; I can delete the cookie which was previously set by the Catalyst app<br>
&gt; (testcookie), but I still can't delete the cookie which was previously set<br>
&gt; by the PHP. This is the PHP code:<br>
<br>
&gt; I tried to add<br>
&gt;     $c-&gt;response-&gt;cookies-&gt;{id} = {<br>
&gt;         value =&gt; [],<br>
&gt;         expires =&gt; time-86400,<br>
&gt;     };<br>
&gt; in your Root/del code but it doesn't work. Only the testcookie got deleted.<br>
<br>
This is good, because we have proven that cookies are working<br>
correctly for you from within catalyst.  The test application cannot<br>
manipulate your other application's cookie because the test<br>
application is running in a different location.<br>
<br>
A web server running on http://localhost:3000 cannot view or<br>
manipulate cookies for http://sin.my.office.com.  This is for security<br>
reasons.  You would not want www.microsoft.com to be able to view or<br>
delete your cookies for www.google.com, for example.<br>
<br>
For your PHP application and your catalyst application to be able to<br>
view/manipulate each others cookies, both applications must be<br>
accessed on the same domain name and be setting their cookies into the<br>
same 'path'.  Please note... http://localhost and<br>
http://localhost:3000 are considered different domain names, and will<br>
not be able to interact with each other's cookies.<br>
<br>
Cookies are programming language and server independent.  All<br>
languages and browsers follow generally the same rules.  Once you<br>
understand what these rules are, you will have a much better<br>
understanding how cookies work in your application and how to<br>
troubleshoot problems.  A very good place to start is the<br>
implementation section in this article:<br>
http://en.wikipedia.org/wiki/HTTP_cookie<br>
<br>
Kind Regards,<br>
<br>
/Mitchell K. Jackson<br>
<br>
On Mon, Jun 2, 2008 at 12:56 AM,  <sindharta_tanuwijaya@yahoo.co.jp> wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt;<br>
&gt; &gt; setcookie("id", "sindharta", time() + 3600, "/", ".sin.my.office.com");<br>
&gt; setcookie("session", "blablablablablabla", time() + 3600, "/",<br>
&gt; ".sin.my.office.com");<br>
&gt; echo "cookies...\n";<br>
&gt; print_r($_COOKIE);<br>
&gt; echo "set!";<br>
&gt; ?&gt;<br>
&gt;<br>
&gt; I tried to add<br>
&gt;     $c-&gt;response-&gt;cookies-&gt;{id} = {<br>
&gt;         value =&gt; [],<br>
&gt;         expires =&gt; time-86400,<br>
&gt;     };<br>
&gt; in your Root/del code but it doesn't work. Only the testcookie got deleted.<br>
&gt;<br>
&gt; Sindharta<br>
&gt;<br>
&gt; sindharta_tanuwijaya@yahoo.co.jp wrote:<br>
&gt;<br>
&gt; Hi Jackson,<br>
&gt;<br>
&gt; Thanks for the source code. I'll be away from my workplace for a few days,<br>
&gt; but I think I'll be back next week, so I'll try your source code and compare<br>
&gt; it with mine at that time.<br>
&gt; I'll let you know how it works.<br>
&gt; Thanks again.<br>
&gt;<br>
&gt; Sindharta<br>
&gt;<br>
&gt; Mitch Jackson <perimus@gmail.com> wrote:<br>
&gt;<br>
&gt; Sindharta,<br>
&gt;<br>
&gt; I created a simple test application to set and delete a cookie, and it<br>
&gt; is working as expected. The correct thing is happening in your<br>
&gt; headers: as you roll back the expire time, that is reflected in the<br>
&gt; headers that get sent.<br>
&gt;<br>
&gt; I've posted my test application here:<br>
&gt; http://perimus.com/files/cookietest.tar.bz If this also does not work<br>
&gt; for you, there is some other problem.<br>
&gt;<br>
&gt; Please check the time/date on your server and the time/date on your<br>
&gt; computer. As an example, If your server thinks it's May 28th 2008 but<br>
&gt; your computer thinks it's May 28th 2007, then your browser still<br>
&gt; thinks the requested expiry time of May 27th 2008 02:00 GMT is a year<br>
&gt; in the future and will preserve the cookie.<br>
&gt;<br>
&gt; Kind Regards,<br>
&gt;<br>
&gt; /Mitchell K. Jackson<br>
&gt;<br>
&gt; On Tue, May 27, 2008 at 9:25 PM, wrote:<br>
&gt;&gt; Thank you for your response. But I am still having the same problem if I<br>
&gt;&gt; don't use Javascript.<br>
&gt;&gt;<br>
&gt;&gt; I added:<br>
&gt;&gt;<br>
&gt;&gt; $c-&gt;delete_session('Logout'); in Root/default<br>
&gt;&gt; $c-&gt;res-&gt;cookies<br>
&gt;&gt; -&gt;{id} = {<br>
&gt;&gt; value =&gt; [],<br>
&gt;&gt; expires =&gt; time()-86400,<br>
&gt;&gt; };<br>
&gt;&gt; $c-&gt;res-&gt;cookies<br>
&gt;&gt; -&gt;{session} = {<br>
&gt;&gt; value =&gt; [],<br>
&gt;&gt; expires =&gt; time()-86400,<br>
&gt;&gt; };<br>
&gt;&gt;<br>
&gt;&gt; and the Firebug Net log would generate:<br>
&gt;&gt; ----------------------------------<br>
&gt;&gt; Response Headers<br>
&gt;&gt; Connection close<br>
&gt;&gt; Date Wed, 28 May 2008 02:13:04 GMT<br>
&gt;&gt; Content-Length 3345<br>
&gt;&gt; Content-Type text/html; charset=utf-8<br>
&gt;&gt; Set-Cookie catalyst_session=cb50670fae865f6266b0bb2c5b992c88093b8dbe;<br>
&gt;&gt; domain=.shindaru.my.office.com; path=/; expires=Wed, 28-May-2008 02:13:04<br>
&gt;&gt; GMT session=; path=/; expires=Tue, 27-May-2008 02:13:04 GMT id=; path=/;<br>
&gt;&gt; expires=Tue, 27-May-2008 02:13:04 GMT<br>
&gt;&gt; Status 200<br>
&gt;&gt; X-Catalyst 5.7013<br>
&gt;&gt;<br>
&gt;&gt; Request Headers<br>
&gt;&gt; Host shindaru.my.office.com:3000<br>
&gt;&gt; User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14)<br>
&gt;&gt; Gecko/20080404 Firefox/2.0.0.14<br>
&gt;&gt; Accept<br>
&gt;&gt;<br>
&gt;&gt; text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5<br>
&gt;&gt; Accept-Language en-us,en;q=0.5<br>
&gt;&gt; Accept-Encoding gzip,deflate<br>
&gt;&gt; Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7<br>
&gt;&gt; Keep-Alive 300<br>
&gt;&gt; Connection keep-alive<br>
&gt;&gt; Cookie __utma=175737056.1376894921.1211863250.1211880303.1211937459.4;<br>
&gt;&gt; session=4alqcz3qqey2wkiokonx; id=sindharta;<br>
&gt;&gt;<br>
&gt;&gt; __utmz=175737056.1211863250.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none);<br>
&gt;&gt; __utma=175737056.1376894921.1211863250.1211880303.1211937459.4<br>
&gt;&gt; Cache-Control max-age=0<br>
&gt;&gt; ----------------------------------<br>
&gt;&gt;<br>
&gt;&gt; But the strange thing is, if I changed the expires into<br>
&gt;&gt; expires =&gt; time()+5,<br>
&gt;&gt; the Firebug log would become:<br>
&gt;&gt;<br>
&gt;&gt; -----------------------------------<br>
&gt;&gt; Response Headers<br>
&gt;&gt; Connection close<br>
&gt;&gt; Date Wed, 28 May 2008 02:18:57 GMT<br>
&gt;&gt; Content-Length 3345<br>
&gt;&gt; Content-Type text/html; charset=utf-8<br>
&gt;&gt; Set-Cookie catalyst_session=70ca66db5210730bc63ccb2fdac240543da0f1a0;<br>
&gt;&gt; domain=.shindaru.my.office.com; path=/; expires=Wed, 28-May-2008 02:18:57<br>
&gt;&gt; GMT session=; path=/; expires=Wed, 28-May-2008 02:19:02 GMT id=; path=/;<br>
&gt;&gt; expires=Wed, 28-May-2008 02:19:02 GMT<br>
&gt;&gt; Status 200<br>
&gt;&gt; X-Catalyst 5.7013<br>
&gt;&gt;<br>
&gt;&gt; Request Headers<br>
&gt;&gt; Host shindaru.my.office.com:3000<br>
&gt;&gt; User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14)<br>
&gt;&gt; Gecko/20080404 Firefox/2.0.0.14<br>
&gt;&gt; Accept<br>
&gt;&gt;<br>
&gt;&gt; text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5<br>
&gt;&gt; Accept-Language en-us,en;q=0.5<br>
&gt;&gt; Accept-Encoding gzip,deflate<br>
&gt;&gt; Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7<br>
&gt;&gt; Keep-Alive 300<br>
&gt;&gt; Connection keep-alive<br>
&gt;&gt; Cookie __utma=175737056.1376894921.1211863250.1211880303.1211937459.4;<br>
&gt;&gt;<br>
&gt;&gt; __utmz=175737056.1211863250.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none);<br>
&gt;&gt; __utma=175737056.1376894921.1211863250.1211880303.1211937459.4;<br>
&gt;&gt; id=sindharta; session=4alqcz3qqey2wkiokonx; session=; id=<br>
&gt;&gt; Cache-Control max-age=0<br>
&gt;&gt; -----------------------------------<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Sindharta<br>
&gt;&gt;<br>
&gt;&gt; Gabriel Vieira wrote:<br>
&gt;&gt;<br>
&gt;&gt; You need to understand how Cookies are writed.<br>
&gt;&gt; Thery are HTTP Headers, so you may be giving an outdated value and<br>
&gt;&gt; next the system gives a update value. Javascript writes the Cookies<br>
&gt;&gt; after HTTP process, so the system values are irrelevant to it.<br>
&gt;&gt;<br>
&gt;&gt; Try to use the Catalyst structure to manipulate them instead of trying<br>
&gt;&gt; to make some code.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Tue, May 27, 2008 at 11:07 AM, Mitch Jackson wrote:<br>
&gt;&gt;&gt;&gt; delete @{ $c-&gt;session }{qw/__user/};<br>
&gt;&gt;&gt;&gt; delete @{ $c-&gt;session }{qw/id/};<br>
&gt;&gt;&gt;&gt; delete @{ $c-&gt;session }{qw/session/};<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Catalyst::Plugin::Session provides a "delete_session" method<br>
&gt;&gt;&gt; http://search.cpan.org/search?query=catalyst%3A%3Aplugin%3A%3Asession<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; $c-&gt;res-&gt;cookies<br>
&gt;&gt;&gt;&gt; -&gt;{id} = {<br>
&gt;&gt;&gt;&gt; value =&gt; [],<br>
&gt;&gt;&gt;&gt; expires =&gt; 0,<br>
&gt;&gt;&gt;&gt; };<br>
&gt;&gt;&gt;&gt; But the cookies just keep appearing, no matter how many times I refresh<br>
&gt;&gt;&gt;&gt; my<br>
&gt;&gt;&gt;&gt; browser. I think there is something wrong, but I just couldn't figure<br>
&gt;&gt;&gt;&gt; out<br>
&gt;&gt;&gt;&gt; where.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; To ask a browser to forget a cookie, the expiry date must be specified<br>
&gt;&gt;&gt; in the past. Try setting expires to time()-86400.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; If you continue to have problems, use Firebug<br>
&gt;&gt;&gt; (http://addons.mozilla.org/firefox/addon/1843) to view the http<br>
&gt;&gt;&gt; headers and see the actual cookie headers received by the browser and<br>
&gt;&gt;&gt; post those here as they are received by the browser.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Kind Regards,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; /Mitchell K. Jackson<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; List: Catalyst@lists.scsys.co.uk<br>
&gt;&gt;&gt; Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst<br>
&gt;&gt;&gt; Searchable archive:<br>
&gt;&gt;&gt; http://www.mail-archive.com/catalyst@lists.scsys.co.uk/<br>
&gt;&gt;&gt; Dev site: http://dev.catalyst.perl.org/<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Gabriel Vieira<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; List: Catalyst@lists.scsys.co.uk<br>
&gt;&gt; Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst<br>
&gt;&gt; Searchable archive:<br>
&gt;&gt; http://www.mail-archive.com/catalyst@lists.scsys.co.uk/<br>
&gt;&gt; Dev site: http://dev.catalyst.perl.org/<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ________________________________<br>
&gt;&gt; GANBARE! NIPPON! Win your ticket to Olympic Games 2008.<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; List: Catalyst@lists.scsys.co.uk<br>
&gt;&gt; Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst<br>
&gt;&gt; Searchable archive:<br>
&gt;&gt; http://www.mail-archive.com/catalyst@lists.scsys.co.uk/<br>
&gt;&gt; Dev site: http://dev.catalyst.perl.org/<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; List: Catalyst@lists.scsys.co.uk<br>
&gt; Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst<br>
&gt; Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/<br>
&gt; Dev site: http://dev.catalyst.perl.org/<br>
&gt;<br>
&gt;<br>
&gt; ________________________________<br>
&gt; GANBARE! NIPPON! Win your ticket to Olympic Games 2008.<br>
&gt; _______________________________________________<br>
&gt; List: Catalyst@lists.scsys.co.uk<br>
&gt; Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst<br>
&gt; Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/<br>
&gt; Dev site: http://dev.catalyst.perl.org/<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ________________________________<br>
&gt; Power up the Internet with Yahoo! Toolbar.<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; List: Catalyst@lists.scsys.co.uk<br>
&gt; Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst<br>
&gt; Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/<br>
&gt; Dev site: http://dev.catalyst.perl.org/<br>
&gt;<br>
&gt;<br>
<br>
_______________________________________________<br>
List: Catalyst@lists.scsys.co.uk<br>
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst<br>
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/<br>
Dev site: http://dev.catalyst.perl.org/<br>
</perimus@gmail.com></sindharta_tanuwijaya@yahoo.co.jp></blockquote><br>

<div style="line-height: 0; width: 0; height: 5px; clear: both;">&nbsp;</div>
<p>&#32;



<hr size=1><a href=http://pr.mail.yahoo.co.jp/toolbar/ target="new">Power up the Internet with Yahoo! Toolbar.</a><br>