Hi Jackson,<br>
<br>
Thanks for the source code. I'll be away from my workplace for a few days, but I think I'll be back next week, so I'll try your source code and compare it with mine at that time.<br>
I'll let you know how it works.<br>
Thanks again.<br>
<br>
Sindharta<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;"> Sindharta,<br>
<br>
I created a simple test application to set and delete a cookie, and it<br>
is working as expected.  The correct thing is happening in your<br>
headers: as you roll back the expire time, that is reflected in the<br>
headers that get sent.<br>
<br>
I've posted my test application here:<br>
http://perimus.com/files/cookietest.tar.bz  If this also does not work<br>
for you, there is some other problem.<br>
<br>
Please check the time/date on your server and the time/date on your<br>
computer.  As an example, If your server thinks it's May 28th 2008 but<br>
your computer thinks it's May 28th 2007, then your browser still<br>
thinks the requested expiry time of May 27th 2008 02:00 GMT is a year<br>
in the future and will preserve the cookie.<br>
<br>
Kind Regards,<br>
<br>
/Mitchell K. Jackson<br>
<br>
On Tue, May 27, 2008 at 9:25 PM,  <sindharta_tanuwijaya@yahoo.co.jp> wrote:<br>
&gt; Thank you for your response. But I am still having the same problem if I<br>
&gt; don't use Javascript.<br>
&gt;<br>
&gt; I added:<br>
&gt;<br>
&gt; $c-&gt;delete_session('Logout'); in Root/default<br>
&gt;     $c-&gt;res-&gt;cookies<br>
&gt;          -&gt;{id} = {<br>
&gt;              value =&gt; [],<br>
&gt;              expires =&gt; time()-86400,<br>
&gt;          };<br>
&gt;     $c-&gt;res-&gt;cookies<br>
&gt;          -&gt;{session} = {<br>
&gt;              value =&gt; [],<br>
&gt;              expires =&gt; time()-86400,<br>
&gt;          };<br>
&gt;<br>
&gt; and the Firebug Net log would generate:<br>
&gt; ----------------------------------<br>
&gt; Response Headers<br>
&gt; Connection  close<br>
&gt; Date  Wed, 28 May 2008 02:13:04 GMT<br>
&gt; Content-Length  3345<br>
&gt; Content-Type  text/html; charset=utf-8<br>
&gt; Set-Cookie  catalyst_session=cb50670fae865f6266b0bb2c5b992c88093b8dbe;<br>
&gt; domain=.shindaru.my.office.com; path=/; expires=Wed, 28-May-2008 02:13:04<br>
&gt; GMT session=; path=/; expires=Tue, 27-May-2008 02:13:04 GMT id=; path=/;<br>
&gt; expires=Tue, 27-May-2008 02:13:04 GMT<br>
&gt; Status  200<br>
&gt; X-Catalyst  5.7013<br>
&gt;<br>
&gt; Request Headers<br>
&gt; Host  shindaru.my.office.com:3000<br>
&gt; User-Agent  Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14)<br>
&gt; Gecko/20080404 Firefox/2.0.0.14<br>
&gt; Accept<br>
&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; Accept-Language en-us,en;q=0.5<br>
&gt; Accept-Encoding gzip,deflate<br>
&gt; Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7<br>
&gt; Keep-Alive  300<br>
&gt; Connection  keep-alive<br>
&gt; Cookie  __utma=175737056.1376894921.1211863250.1211880303.1211937459.4;<br>
&gt; session=4alqcz3qqey2wkiokonx; id=sindharta;<br>
&gt; __utmz=175737056.1211863250.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none);<br>
&gt; __utma=175737056.1376894921.1211863250.1211880303.1211937459.4<br>
&gt; Cache-Control max-age=0<br>
&gt; ----------------------------------<br>
&gt;<br>
&gt; But the strange thing is, if I changed the expires into<br>
&gt;              expires =&gt; time()+5,<br>
&gt; the Firebug log would become:<br>
&gt;<br>
&gt; -----------------------------------<br>
&gt; Response Headers<br>
&gt; Connection  close<br>
&gt; Date  Wed, 28 May 2008 02:18:57 GMT<br>
&gt; Content-Length  3345<br>
&gt; Content-Type  text/html; charset=utf-8<br>
&gt; Set-Cookie  catalyst_session=70ca66db5210730bc63ccb2fdac240543da0f1a0;<br>
&gt; domain=.shindaru.my.office.com; path=/; expires=Wed, 28-May-2008 02:18:57<br>
&gt; GMT session=; path=/; expires=Wed, 28-May-2008 02:19:02 GMT id=; path=/;<br>
&gt; expires=Wed, 28-May-2008 02:19:02 GMT<br>
&gt; Status  200<br>
&gt; X-Catalyst  5.7013<br>
&gt;<br>
&gt; Request Headers<br>
&gt; Host  shindaru.my.office.com:3000<br>
&gt; User-Agent  Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14)<br>
&gt; Gecko/20080404 Firefox/2.0.0.14<br>
&gt; Accept<br>
&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; Accept-Language en-us,en;q=0.5<br>
&gt; Accept-Encoding gzip,deflate<br>
&gt; Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7<br>
&gt; Keep-Alive  300<br>
&gt; Connection  keep-alive<br>
&gt; Cookie  __utma=175737056.1376894921.1211863250.1211880303.1211937459.4;<br>
&gt; __utmz=175737056.1211863250.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none);<br>
&gt; __utma=175737056.1376894921.1211863250.1211880303.1211937459.4;<br>
&gt; id=sindharta; session=4alqcz3qqey2wkiokonx; session=; id=<br>
&gt; Cache-Control max-age=0<br>
&gt; -----------------------------------<br>
&gt;<br>
&gt;<br>
&gt; Sindharta<br>
&gt;<br>
&gt; Gabriel Vieira <gabriel.vieira@gmail.com> wrote:<br>
&gt;<br>
&gt; You need to understand how Cookies are writed.<br>
&gt; Thery are HTTP Headers, so you may be giving an outdated value and<br>
&gt; next the system gives a update value. Javascript writes the Cookies<br>
&gt; after HTTP process, so the system values are irrelevant to it.<br>
&gt;<br>
&gt; Try to use the Catalyst structure to manipulate them instead of trying<br>
&gt; to make some code.<br>
&gt;<br>
&gt;<br>
&gt; On Tue, May 27, 2008 at 11:07 AM, Mitch Jackson wrote:<br>
&gt;&gt;&gt; delete @{ $c-&gt;session }{qw/__user/};<br>
&gt;&gt;&gt; delete @{ $c-&gt;session }{qw/id/};<br>
&gt;&gt;&gt; delete @{ $c-&gt;session }{qw/session/};<br>
&gt;&gt;<br>
&gt;&gt; Catalyst::Plugin::Session provides a "delete_session" method<br>
&gt;&gt; http://search.cpan.org/search?query=catalyst%3A%3Aplugin%3A%3Asession<br>
&gt;&gt;<br>
&gt;&gt;&gt; $c-&gt;res-&gt;cookies<br>
&gt;&gt;&gt; -&gt;{id} = {<br>
&gt;&gt;&gt; value =&gt; [],<br>
&gt;&gt;&gt; expires =&gt; 0,<br>
&gt;&gt;&gt; };<br>
&gt;&gt;&gt; But the cookies just keep appearing, no matter how many times I refresh<br>
&gt;&gt;&gt; my<br>
&gt;&gt;&gt; browser. I think there is something wrong, but I just couldn't figure out<br>
&gt;&gt;&gt; where.<br>
&gt;&gt;<br>
&gt;&gt; To ask a browser to forget a cookie, the expiry date must be specified<br>
&gt;&gt; in the past. Try setting expires to time()-86400.<br>
&gt;&gt;<br>
&gt;&gt; If you continue to have problems, use Firebug<br>
&gt;&gt; (http://addons.mozilla.org/firefox/addon/1843) to view the http<br>
&gt;&gt; headers and see the actual cookie headers received by the browser and<br>
&gt;&gt; post those here as they are received by the browser.<br>
&gt;&gt;<br>
&gt;&gt; Kind Regards,<br>
&gt;&gt;<br>
&gt;&gt; /Mitchell K. Jackson<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;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Gabriel Vieira<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; ________________________________<br>
&gt; GANBARE! NIPPON! Win your ticket to Olympic Games 2008.<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>
</gabriel.vieira@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/ganbare-nippon/ target="new">GANBARE! NIPPON! Win your ticket to Olympic Games 2008.</a><br>