librelist archives

« back to archive

Logout in photon

Logout in photon

From:
William Martin
Date:
2011-10-07 @ 12:58
Hi,

Did they have something to reset a session in photon ?

William

-- 
---------------------------------------------------------
William MARTIN
wysman @NoSpAm@ gmail @DoT@ com

Re: [photon.users] Logout in photon

From:
Loic d'Anterroches
Date:
2011-10-07 @ 13:06

On 2011-10-07 14:58, William MARTIN wrote:
> Hi,
> 
> Did they have something to reset a session in photon ?

Delete the session cookie. Nothing more.

loïc

Re: [photon.users] Logout in photon

From:
William Martin
Date:
2011-10-07 @ 13:07
Yes, but the middleware class \photon\session\Middleware will rewrite it !

On Fri, Oct 7, 2011 at 3:06 PM, Loic d'Anterroches <loic@ceondo.com> wrote:
>
>
> On 2011-10-07 14:58, William MARTIN wrote:
>> Hi,
>>
>> Did they have something to reset a session in photon ?
>
> Delete the session cookie. Nothing more.
>
> loïc
>



-- 
---------------------------------------------------------
William MARTIN
wysman @NoSpAm@ gmail @DoT@ com

Re: [photon.users] Logout in photon

From:
Loic d'Anterroches
Date:
2011-10-07 @ 13:12

On 2011-10-07 15:07, William MARTIN wrote:
> Yes, but the middleware class \photon\session\Middleware will rewrite it !

Ok, I see, try something like that:

Delete the session data.
Delete the cookie.
Then set:
$request->session->accessed = false;
$request->session->modified = false;

This is a hack and we should have something like
$request->session->purge(); to remove both the cookie info and all the
data in the session "backend".

loïc


> On Fri, Oct 7, 2011 at 3:06 PM, Loic d'Anterroches <loic@ceondo.com> wrote:
>>
>>
>> On 2011-10-07 14:58, William MARTIN wrote:
>>> Hi,
>>>
>>> Did they have something to reset a session in photon ?
>>
>> Delete the session cookie. Nothing more.
>>
>> loïc
>>
> 
> 
> 

-- 
Dr Loïc d'Anterroches
Founder Céondo Ltd

w: www.ceondo.com       |  e: loic@ceondo.com
t: +44 (0)207 183 0016  |  f: +44 (0)207 183 0124

Céondo Ltd
Dalton House
60 Windsor Avenue
London
SW19 2RR / United Kingdom

Re: [photon.users] Logout in photon

From:
William Martin
Date:
2011-10-07 @ 13:18
Thanks,

This logout code is working.

    public function logout($request, $match)
    {
        $request->session->store->data = array();
        $request->session->accessed = false;
        $request->session->modified = false;

        $view = Conf::f('logout_success_view');
        $url = URL::forView($view);
        $response = new Redirect($url);
        $request->session->commit($response);
        $response->COOKIE->delCookie(Conf::f('session_cookie_name', 'sid'));
        return $response;
    }




On Fri, Oct 7, 2011 at 3:12 PM, Loic d'Anterroches <loic@ceondo.com> wrote:
>
>
> On 2011-10-07 15:07, William MARTIN wrote:
>> Yes, but the middleware class \photon\session\Middleware will rewrite it !
>
> Ok, I see, try something like that:
>
> Delete the session data.
> Delete the cookie.
> Then set:
> $request->session->accessed = false;
> $request->session->modified = false;
>
> This is a hack and we should have something like
> $request->session->purge(); to remove both the cookie info and all the
> data in the session "backend".
>
> loïc
>
>
>> On Fri, Oct 7, 2011 at 3:06 PM, Loic d'Anterroches <loic@ceondo.com> wrote:
>>>
>>>
>>> On 2011-10-07 14:58, William MARTIN wrote:
>>>> Hi,
>>>>
>>>> Did they have something to reset a session in photon ?
>>>
>>> Delete the session cookie. Nothing more.
>>>
>>> loïc
>>>
>>
>>
>>
>
> --
> Dr Loïc d'Anterroches
> Founder Céondo Ltd
>
> w: www.ceondo.com       |  e: loic@ceondo.com
> t: +44 (0)207 183 0016  |  f: +44 (0)207 183 0124
>
> Céondo Ltd
> Dalton House
> 60 Windsor Avenue
> London
> SW19 2RR / United Kingdom
>



-- 
---------------------------------------------------------
William MARTIN
wysman @NoSpAm@ gmail @DoT@ com