Autologout implementation

View: New views
6 Messages — Rating Filter:   Alert me  

Autologout implementation

by Stefan Schmiedl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How would you implement automatic logout after a given period of
inactivity?

The app is running in a workshop, where a bunch of people use the same
machine to access their scheduled tasks and other stuff. They will often
leave "their" last page on the screen, so the goal donor requested an
automated reload of the starting page.

I did this for another app (in IOWA on Ruby) by meta-refreshing to the
"/logout" page, which in turn expired the session and redirected to the
starting page.

Below is what I came up with in Seaside. This decoration is
autmatically added to the pages if the users are in the autologout
category.

Has anybody a better idea for this?

Thanks,
s.


Smalltalk.HS defineClass: #AutoLogoutDecoration
        superclass: #{Seaside.WADecoration}
        indexedType: #none
        private: false
        instanceVariableNames: 'delay '
        classInstanceVariableNames: ''
        imports: ''
        category: ''!

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!


!HS.AutoLogoutDecoration class methodsFor: 'instance creation'!

delay: seconds
       
        ^(self new) delay: seconds;
                yourself! !

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!


!HS.AutoLogoutDecoration methodsFor: 'updating'!

updateRoot: root
       
        root redirectTo: self urlForExpiry asString
                delay: self delay!

urlForExpiry
       
        Continuation currentDo: [:cc | ^self session actionUrlForContinuation: cc].
        (self session) expire;
                redirect! !

!HS.AutoLogoutDecoration methodsFor: 'accessing'!

delay
        ^delay!

delay: anObject
        delay := anObject! !
_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

Re: Autologout implementation

by Philippe Marschall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2008/4/27, Stefan Schmiedl <s@...>:
> How would you implement automatic logout after a given period of
>  inactivity?

Set the session timeout to this value.

Cheers
Philippe

>  The app is running in a workshop, where a bunch of people use the same
>  machine to access their scheduled tasks and other stuff. They will often
>  leave "their" last page on the screen, so the goal donor requested an
>  automated reload of the starting page.
>
>  I did this for another app (in IOWA on Ruby) by meta-refreshing to the
>  "/logout" page, which in turn expired the session and redirected to the
>  starting page.
>
>  Below is what I came up with in Seaside. This decoration is
>  autmatically added to the pages if the users are in the autologout
>  category.
>
>  Has anybody a better idea for this?
>
>  Thanks,
>  s.
>
>
>  Smalltalk.HS defineClass: #AutoLogoutDecoration
>         superclass: #{Seaside.WADecoration}
>         indexedType: #none
>         private: false
>         instanceVariableNames: 'delay '
>         classInstanceVariableNames: ''
>         imports: ''
>         category: ''!
>
>  "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
>
>
>  !HS.AutoLogoutDecoration class methodsFor: 'instance creation'!
>
>  delay: seconds
>
>         ^(self new) delay: seconds;
>                 yourself! !
>
>  "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
>
>
>  !HS.AutoLogoutDecoration methodsFor: 'updating'!
>
>  updateRoot: root
>
>         root redirectTo: self urlForExpiry asString
>                 delay: self delay!
>
>  urlForExpiry
>
>         Continuation currentDo: [:cc | ^self session actionUrlForContinuation: cc].
>         (self session) expire;
>                 redirect! !
>
>  !HS.AutoLogoutDecoration methodsFor: 'accessing'!
>
>  delay
>         ^delay!
>
>  delay: anObject
>         delay := anObject! !
>  _______________________________________________
>  seaside mailing list
>  seaside@...
>  http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

Parent Message unknown Re: Autologout implementation

by Boris Popov-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Re: [Seaside] Autologout implementation

I think he wanted the app to go back to the home page automatically when auto expiring. In which case you can just add a refresh periodical with lifetime just a tad longer than a session timeout.

Cheers!

-Boris (via BlackBerry)

----- Original Message -----
From: seaside-bounces@... <seaside-bounces@...>
To: Seaside - general discussion <seaside@...>
Sent: Sun Apr 27 11:40:45 2008
Subject: Re: [Seaside] Autologout implementation

2008/4/27, Stefan Schmiedl <s@...>:
> How would you implement automatic logout after a given period of
>  inactivity?

Set the session timeout to this value.

Cheers
Philippe

>  The app is running in a workshop, where a bunch of people use the same
>  machine to access their scheduled tasks and other stuff. They will often
>  leave "their" last page on the screen, so the goal donor requested an
>  automated reload of the starting page.
>
>  I did this for another app (in IOWA on Ruby) by meta-refreshing to the
>  "/logout" page, which in turn expired the session and redirected to the
>  starting page.
>
>  Below is what I came up with in Seaside. This decoration is
>  autmatically added to the pages if the users are in the autologout
>  category.
>
>  Has anybody a better idea for this?
>
>  Thanks,
>  s.
>
>
>  Smalltalk.HS defineClass: #AutoLogoutDecoration
>         superclass: #{Seaside.WADecoration}
>         indexedType: #none
>         private: false
>         instanceVariableNames: 'delay '
>         classInstanceVariableNames: ''
>         imports: ''
>         category: ''!
>
>  "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
>
>
>  !HS.AutoLogoutDecoration class methodsFor: 'instance creation'!
>
>  delay: seconds
>
>         ^(self new) delay: seconds;
>                 yourself! !
>
>  "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
>
>
>  !HS.AutoLogoutDecoration methodsFor: 'updating'!
>
>  updateRoot: root
>
>         root redirectTo: self urlForExpiry asString
>                 delay: self delay!
>
>  urlForExpiry
>
>         Continuation currentDo: [:cc | ^self session actionUrlForContinuation: cc].
>         (self session) expire;
>                 redirect! !
>
>  !HS.AutoLogoutDecoration methodsFor: 'accessing'!
>
>  delay
>         ^delay!
>
>  delay: anObject
>         delay := anObject! !
>  _______________________________________________
>  seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

Re: Autologout implementation

by Stefan Schmiedl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 27 Apr 2008 20:40:45 +0200
"Philippe Marschall" <philippe.marschall@...> wrote:

> 2008/4/27, Stefan Schmiedl <s@...>:
> > How would you implement automatic logout after a given period of
> >  inactivity?
>
> Set the session timeout to this value.

Instead of manually expiring it, yes. This could happen after
authentication on a per-user basis.

But I still need the reload of the start page so that the machine
appears "free".

hmm... I need to try what happens when I set the session timeout to
120s and refresh after 125s.

Thanks,
s.

>
> Cheers
> Philippe
>
> >  The app is running in a workshop, where a bunch of people use the same
> >  machine to access their scheduled tasks and other stuff. They will often
> >  leave "their" last page on the screen, so the goal donor requested an
> >  automated reload of the starting page.
_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

Re: Autologout implementation

by Stefan Schmiedl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 27 Apr 2008 12:50:33 -0700
"Boris Popov" <boris@...> wrote:

> I think he wanted the app to go back to the home page automatically when auto
> expiring. In which case you can just add a refresh periodical with lifetime
> just a tad longer than a session timeout.

Ah. I see that I'm on the right track .-)

s.
_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

Re: Autologout implementation

by cdrick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2008/4/27 Stefan Schmiedl <s@...>:
> On Sun, 27 Apr 2008 12:50:33 -0700
>  "Boris Popov" <boris@...> wrote:
>
>  > I think he wanted the app to go back to the home page automatically when auto
>  > expiring. In which case you can just add a refresh periodical with lifetime
>  > just a tad longer than a session timeout.
>
>  Ah. I see that I'm on the right track .-)
>

Is subclassing WARedirectHandler a way to go here?

Cédrick

_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside