Logging out from a session in 3.1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Logging out from a session in 3.1

Esteban A. Maringolo
Hi,

I migrated to Seaside 3.1 and now the session behaves differently.

My session class had a #logout method which did:

#logout
  self unregister.
   self redirectTo: '/', (WADispatcher default nameOfHandler: self application)

But now there is no #redirectTo: in the WASession hierarchy. How can I
implement the same functionality?

Also if I unregister, there is no handler installed, and self
application returns nil, and #nameOfHandler: throws an exception.

What is the proper way of performing this in Seaside 3.1?


Esteban A. Maringolo
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Logging out from a session in 3.1

Johan Brichau-2
Esteban,

> I migrated to Seaside 3.1 and now the session behaves differently.
>
> My session class had a #logout method which did:
>
> #logout
>  self unregister.
>   self redirectTo: '/', (WADispatcher default nameOfHandler: self application)
>
> But now there is no #redirectTo: in the WASession hierarchy. How can I
> implement the same functionality?

This was a deprecated method in Seaside 3.0:

        self
                greaseDeprecatedApi: 'WASession>>#redirectTo:'
                details: 'Use WARequestContext>>#redirectTo:.'.
        self requestContext redirectTo: aUrlOrString

Where did you send #logout? I think you need to move the method to a callback in a component and have it send unregister to the session and redirect.
This is what we typically do:

        self session unregister.
        self requestContext redirectTo: self application url

> Also if I unregister, there is no handler installed, and self
> application returns nil, and #nameOfHandler: throws an exception.
>
> What is the proper way of performing this in Seaside 3.1?

Can you give some more details? I don't quite see what you mean.

best
Johan_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Logging out from a session in 3.1

Esteban A. Maringolo
Johan,

2014-02-26 16:15 GMT-03:00 Johan Brichau <[hidden email]>:
> Esteban,
>
>> I migrated to Seaside 3.1 and now the session behaves differently.

> Where did you send #logout? I think you need to move the method to a callback in a component and have it send unregister to the session and redirect.
> This is what we typically do:
>
>         self session unregister.
>         self requestContext redirectTo: self application url
>
>> Also if I unregister, there is no handler installed, and self
>> application returns nil, and #nameOfHandler: throws an exception.
>>
>> What is the proper way of performing this in Seaside 3.1?
>
> Can you give some more details? I don't quite see what you mean.

I was using #logout at the session level, but it was called from a
callback in a component.
So now I implemented your suggested way in the component and now it
works as expected.

What I wanted to do was to "close the session" but forcing the removal
of the session from the registry, so there is no way to go back and
submit a new request whitin the same session or using the session id.

Regards!

Esteban A. Maringolo
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside