Based on what I know about how ASP sessions and "applications" work,
and how Rails operates, I don''t think this is really possible. It
would be easy enough to code an Session_OnStart equivalent with a
before_filter method that just checks to see if @session contains any
data, but I don''t think there''s any way to set a callback for
when a
session expires on the server. ASP can do that because its sessioning
is very closely tied with how IIS operates.
You might be able to do something mimicing IIS''s conception of an
"Application" with Apache or FastCGI configurations, but that would be
outside of Rails. Better, I think, to store any application-wide data
in your database.
In the end, I can''t think of any reason to even worry about the OnEnd
equivalents anyway. But maybe if you gave us an idea of what problem
you are trying to solve, the list could come up with some other
options for you besides emulating IIS.
-dave
On 4/18/05, Gavin Kistner <gavin-XtLdkLkwz3ZWk0Htik3J/w@public.gmane.org>
wrote:> ASP has the ability to run code when the application starts and stops,
> as well as run code when a session begins and ends.
> You can see an example of these in nasty VBScript at
> http://www.w3schools.com/asp/ev_sess_onend_onstart.asp
>
> Does rails have an equivalent? If not explicitly, how would I mimic
> these functions?
>
> (At current, my only goal is the need to run some code once after the
> application has fully initialized. However, I have used Session_OnStart
> and Session_OnEnd in the past when doing ASP development, and suspect
> that they may come to be another explicit feature pair I need.)
> --
> (-, /\ \/ / /\/
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>