end
end
+#Change the session store key, so that it will not conflict with other webapps
+ActionController::Base.session_options[:session_key] = 'selectricity_session_id'
+CGI::Session.expire_after 1.year
+
# action mailer configuration
ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.default_charset = "utf-8"
t.column "enddate", :datetime, :null => false
t.column "active", :integer, :limit => 4, :default => 0, :null => false
t.column "user_id", :integer
+ t.column "quickuser", :string
t.column "election_method", :string, :limit => 100, :default => "ssd"
t.column "type", :string, :limit => 100, :default => "", :null => false
end
--- /dev/null
+# Provides the ability to have session cookies for your Rails app calculated
+# relative to the current time.
+#
+# In your environment.rb file (or in the environments/*.rb file of your choice),
+# do something like the following:
+#
+# CGI::Session.expire_after 1.month
+#
+# Session cookies will then expire one month after the session was created. This
+# differs from the usual session cookie behavior in that the expiration date is
+# not a fixed time, but rather relative to the current time.
+
+class CGI
+ class Session
+ @@session_expiration_offset = 0
+
+ def self.session_expiration_offset
+ @@session_expiration_offset
+ end
+
+ def self.session_expiration_offset=(value)
+ @@session_expiration_offset = value
+ end
+
+ def self.expire_after(value)
+ @@session_expiration_offset = value
+ end
+
+ alias :initialize_without_dynamic_session_expiration :initialize #:nodoc:
+ def initialize(request, option={}) #:nodoc:
+ if @@session_expiration_offset && @@session_expiration_offset > 0
+ option['session_expires'] = Time.now + @@session_expiration_offset
+ end
+ initialize_without_dynamic_session_expiration(request, option)
+ end
+
+ end
+end
\ No newline at end of file