persistent login beyond browser close

15 views
Skip to first unread message

Gaku

unread,
Dec 7, 2009, 5:29:32 AM12/7/09
to RubyCAS
Hi there,

I've been using RubyCAS and it is working great. However, I noticed
that I need to authenticate myself every time I start a browser. I'd
like to keep myself logged in for, say, a week.

I believe RubyCAS's authentication state is kept in session cookies
and thus the browser lose the state. Can I somehow copy the
information to persistent cookies to achieve this?

Thanks,
-gaku

Matt Zukowski

unread,
Dec 8, 2009, 2:14:27 PM12/8/09
to rubycas...@googlegroups.com
You may be able to do this by setting the maximum_session_lifetime value in the config.yml for your RubyCAS Server.

Set it to the number of seconds you want to user to stay logged in for. So for one week it would be 60 * 60 * 24 * 7


--

You received this message because you are subscribed to the Google Groups "RubyCAS" group.
To post to this group, send email to rubycas...@googlegroups.com.
To unsubscribe from this group, send email to rubycas-serve...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubycas-server?hl=en.



Gaku

unread,
Dec 9, 2009, 3:59:28 AM12/9/09
to RubyCAS
Matt,

Thanks for the reply.

It turned out that it was not RubyCAS specific, but Rails only kept
the session info into a session cookie.

By addling :session_expires to config.action_controller.sesison hash,
I could write session info to a persistent cookie.

config/environment.rb

config.action_controller.session = {
:session_key => '_myapp_session',
:secret =>
'.....................................................',
:session_expires => 30.day.from_now
}

Now it works for me!

Thanks,
-gaku

On Dec 8, 11:14 am, Matt Zukowski <matt.zukow...@gmail.com> wrote:
> You may be able to do this by setting the maximum_session_lifetime value in
> the config.yml for your RubyCAS Server.
>
> Set it to the number of seconds you want to user to stay logged in for. So
> for one week it would be 60 * 60 * 24 * 7
>
> On Mon, Dec 7, 2009 at 5:29 AM, Gaku <gakuu...@gmail.com> wrote:
> > Hi there,
>
> > I've been using RubyCAS and it is working great.  However, I noticed
> > that I need to authenticate myself every time I start a browser.  I'd
> > like to keep myself logged in for, say, a week.
>
> > I believe RubyCAS's authentication state is kept in session cookies
> > and thus the browser lose the state.  Can I somehow copy the
> > information to persistent cookies to achieve this?
>
> > Thanks,
> > -gaku
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "RubyCAS" group.
> > To post to this group, send email to rubycas...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > rubycas-serve...@googlegroups.com<rubycas-server%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages