This is how i changed the order of persistence via an initialiser.
persistance_chain = Authlogic::Session::Base.persist_callback_chain
persistance_chain_methods = persistance_chain.collect(&:method)
if persistance_chain_methods.index(:persist_by_cookie) <
persistance_chain_methods.index(:persist_by_session)
a = persistance_chain_methods.index(:persist_by_cookie)
b = persistance_chain_methods.index(:persist_by_session)
#
# We can do this, because we get a reference to the array, not a dup
#
persistance_chain[a], persistance_chain[b] = persistance_chain[b],
persistance_chain[a]
end
On Oct 29, 10:31 am, Bertg <
bertgoeth...@gmail.com> wrote:
> Hey,
>
> I'm working on this as well,
>
> Currently I'm able to detect if asessionis persisted bycookie:
>
> module Authlogic
>
> moduleSession
>
> module Cookies
>
> module InstanceMethods
>
> private
>
> def persist_by_cookie_with_login_count
> if persist_by_cookie_without_login_count
> Rails.logger.debug "### Persisted viacookie"
> else
> Rails.logger.debug "### Did not persisted viacookie"
> end
> end
>
> alias_method_chain :persist_by_cookie, :login_count
>
> end
>
> end
>
> end
> end
>
> Problem is that persisting viacookieis donebeforepersisting viasession, so it is always persisting viacookieif it's available.
> I'm now trying to figure out how to change that order without
> modifying the gem.
>
> Greetz,
>
> On Oct 12, 3:58 pm, RangerRick <
rbra...@gmail.com> wrote:
>
>
>
> > Let me rephrase. I need to redirect to a specific page after
> > AuthLogic automatically logs in using its persistentcookie
> > login.
>
> > Currently, the browser is caching my page and I need to force
> > a page refresh to ensure the page is showing fresh data upon
> >sessionrestore.
>
> > Anyone?
>
> > Rick
>
> > On Oct 11, 2:39 pm, RangerRick <
rbra...@gmail.com> wrote:> Hi,
>
> > > I'm in need of detecting when a persistedsessionis restarted, so I
> > > can handle some application-specific things.
>
> > > Is there a standard way to detect "sessionrestart" w/ AuthLogic?
>
> > > Many thanks.
>
> > > Rick