You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ruby-dev@lucene.apache.org by Antonio Eggberg <an...@yahoo.se> on 2007/05/02 12:30:31 UTC

flare sessions

Hi:

First of all I am no sessions expert so please advice if you notice something is wrong. Having
said that
here is my problem:

1. I have a login/logout rails app. The apps job is to authorize folks and re-direct folks to
other rails app.
2. I am using 1 database for simplicity
3. I have flare as a seperate rails app which checks a user from the login app and provides flare
search service.

I been having trouble syncing the two app due to session mismatch. i.e Flare app adds some session
which
are not available in login app. So the easiest solution was to have flare plugin in login app as
well as call flare
in the login controller thus getting all the session variables in sync. This works but I am not
sure what kind
of side effect it might have.. i.e performance etc.

How are you guys doing it? for me login/logout app has to be a separate app cos it might be in a
different machine
basically the idea is a "poor mans single sign-on" 

This is not really flare related but I would very greatfull to hear your views about it.

Regards
A


      Låt vårkänslorna spira.
Hitta din tvillingsjäl på Yahoo! Dejting: http://se.meetic.yahoo.net

Re: flare sessions

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On May 2, 2007, at 6:30 AM, Antonio Eggberg wrote:
> How are you guys doing it? for me login/logout app has to be a  
> separate app cos it might be in a
> different machine
> basically the idea is a "poor mans single sign-on"

I didn't quite read this far for my first reply, obviously.   
Apologies for missing the mark on your exact need.   The tie to  
session scope for the FlareContext is purely a punt on my part to  
design it more flexibly from the start.  So don't feel tied to using  
the FlareContext in that manner.

I'm sure there are other tidbits more specific about how you could  
pass through session keys on your communications with the Flare app  
so that the current session scope works.  Roughly it'd involve  
passing through some HTTP headers to the Flare app just like your  
browser does.  Cookies.   Using Firefox and FireBug you'll be able to  
see what your browser does talking to flare.  Emulate that :)

	Erik


Re: flare sessions

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
I use Flare as a plugin in this manner for Blacklight - http:// 
aleph.lib.virginia.edu/blacklight - :


$ svn proplist -v vendor/plugins/
Properties on 'vendor/plugins':
   svn:externals : flare http://svn.apache.org/repos/asf/lucene/solr/ 
trunk/client/ruby/flare/vendor/plugins/flare/

This of course relies on you using Subversion for your project.   
Actually locally I override that and symlink it to my local flare  
development directory, so I don't have to commit changes to flare and  
then update blacklight to test things out.  I just change it and  
reload/refresh.

  $ ls -l vendor/plugins/
total 8
drwxr-xr-x   7 erik  erik  238 Apr  6 16:53 exception_notification
lrwxr-xr-x   1 erik  erik   38 Apr 12 20:53 flare -> /Users/erik/ 
flare/vendor/plugins/flare
drwxr-xr-x   5 erik  erik  170 Apr  6 16:53 solr-ruby

I don't recommend having Flare as a separate Rails app.  It was  
always intended to be used as a plugin inside of your own custom  
Rails application, such that it would benefit from tight integration  
like you're after with sessions, not to mention the UI with layouts,  
etc.

If folks use flare like a plugin, it'll be much easier for us to see  
where to aim our efforts for evolving it.  For example, a lot of the  
UI pieces can be generalized into views within the plugin, so your  
own Rails app wouldn't need to have templates for the stock stuff  
like facet lists with pie charts, etc.  We'll make high-level helpers  
that generate the view which can be easily overridden for  
customizations.  That's the idea!

	Erik


On May 2, 2007, at 6:30 AM, Antonio Eggberg wrote:

> Hi:
>
> First of all I am no sessions expert so please advice if you notice  
> something is wrong. Having
> said that
> here is my problem:
>
> 1. I have a login/logout rails app. The apps job is to authorize  
> folks and re-direct folks to
> other rails app.
> 2. I am using 1 database for simplicity
> 3. I have flare as a seperate rails app which checks a user from  
> the login app and provides flare
> search service.
>
> I been having trouble syncing the two app due to session mismatch.  
> i.e Flare app adds some session
> which
> are not available in login app. So the easiest solution was to have  
> flare plugin in login app as
> well as call flare
> in the login controller thus getting all the session variables in  
> sync. This works but I am not
> sure what kind
> of side effect it might have.. i.e performance etc.
>
> How are you guys doing it? for me login/logout app has to be a  
> separate app cos it might be in a
> different machine
> basically the idea is a "poor mans single sign-on"
>
> This is not really flare related but I would very greatfull to hear  
> your views about it.
>
> Regards
> A
>
>
>       Låt vårkänslorna spira.
> Hitta din tvillingsjäl på Yahoo! Dejting: http://se.meetic.yahoo.net