Might sound stupid, but I tried deleting the cookie using Javascript and it worked. I am just wondering though if we can manipulate the cookies in Catalyst ?<br>
<br>
Sindharta<br>
<br>
<b>sindharta_tanuwijaya@yahoo.co.jp</b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hm, I just made a test application to test it. I included<br>
<br>
Session<br>
Session::Store::Memcached<br>
Session::State::Cookie<br>
<br>
in my app, added the following lines to app.yml<br>
<br>
session:<br>
cookie_domain: '.sin.my.office.com'<br>
memcached_new_args:<br>
data:<br>
- localhost:11211<br>
verify_address: 0<br>
<br>
and in Controller/Root.pm, default:<br>
<br>
$c->stash->{cookie_id}=$c->req->cookies->{id};<br>
$c->stash->{cookie_session}=$c->req->cookies->{session};<br>
<br>
delete @{ $c->session }{qw/__user/};<br>
delete @{ $c->session }{qw/id/};<br>
delete @{ $c->session }{qw/session/};<br>
<br>
$c->res->cookies<br>
->{id} = {<br>
value => [],<br>
expires => 0,<br>
};<br>
$c->res->cookies<br>
->{session} = {<br>
value => [],<br>
expires => 0,<br>
};<br>
$c->req->cookies<br>
->{id} = {<br>
value => [],<br>
expires => 0,<br>
};<br>
$c->req->cookies<br>
->{session} = {<br>
value => [],<br>
expires => 0,<br>
};<br>
$c->stash->{template}='index.tt2';<br>
<br>
But the cookies just keep appearing, no matter how many times I refresh my browser. I think there is something wrong, but I just couldn't figure out where.<br>
Any ideas ? It couldn't be the memcached, could it ?<br>
<br>
Sindharta<br>
<br>
<b>Gabriel Vieira <gabriel.vieira@gmail.com></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> The content changes? If yes, maybe you're updating the cookies after<br>
the routine which should set it to a outdate value (the command you<br>
just sended). If no, you are not accessing the right cookie.<br>
<br>
On Mon, May 26, 2008 at 8:10 AM, <sindharta_tanuwijaya@yahoo.co.jp> wrote:<br>
> Hi,<br>
><br>
> We are currently building an add-on for a site, which was built by using<br>
> CGI, while the add-on is made by using Catalyst.<br>
> Let's say that the sessions in the old site can be maintained by this simple<br>
> PHP program.<br>
><br>
> > setcookie("id", "sindharta", time() + 3600, "/", ".sin.my.office.com");<br>
> setcookie("session", "blablablablablabla", time() + 3600, "/",<br>
> ".sin.my.office.com");<br>
> echo "cookies...\n";<br>
> print_r($_COOKIE);<br>
> echo "set!";<br>
> ?><br>
><br>
> As you probably know, that's to set the login id, and you'll notice that I<br>
> am not using Catalyst::Plugin::Authentication. Now, in the new add-on, I<br>
> want to have a logout button so that the user can log out directly too, but<br>
> I am having difficulty in programming that.<br>
><br>
> I have tried things such as:<br>
> --<br>
> delete @{ $c->session }{qw/id/};<br>
> $c->res->cookies<br>
> ->{$cookie_name} = {<br>
> value => [],<br>
> expires => 0,<br>
> };<br>
><br>
> my $cookies = fetch CGI::Simple::Cookie;<br>
> $cookies->{session}->value([]);<br>
> $cookies->{id}->value([]);<br>
> --<br>
><br>
> But the cookie just won't disappear, it keeps coming back so that although I<br>
> have pressed logout button, I am still considered as "login".<br>
> Any ideas what went wrong here ?<br>
><br>
> Sindharta<br>
><br>
><br>
><br>
> ________________________________<br>
> GANBARE! NIPPON! Win your ticket to Olympic Games 2008.<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>
><br>
><br>
<br>
<br>
<br>
-- <br>
Gabriel Vieira<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>
</sindharta_tanuwijaya@yahoo.co.jp></blockquote><br>
<div style="line-height: 0pt; width: 0pt; height: 5px; clear: both;"> </div> <div> </div><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>
_______________________________________________<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>
</blockquote><br>
<div style="line-height: 0; width: 0; height: 5px; clear: both;"> </div>
<p> 
<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>