Fixed "lost session cookie" bug.

This commit is contained in:
Martin Edenhofer 2013-08-25 23:34:54 +02:00
parent fd003053cf
commit b6398744b0
2 changed files with 5 additions and 2 deletions

View file

@ -79,7 +79,10 @@ class ApplicationController < ActionController::Base
# update session updated_at
def session_update
session[:ping] = Time.now.utc.iso8601
# on many paralell requests, session got reinitialised if Time. is used, as workaround use DateTime.
#session[:ping] = Time.now.utc.iso8601
session[:ping] = DateTime.now.iso8601
# check if remote ip need to be updated
if !session[:remote_id] || session[:remote_id] != request.remote_ip

View file

@ -14,7 +14,7 @@ class Observer::Session < ActiveRecord::Observer
def check(record)
return if !record.data
return if record[:request_type]
# remember request type
if record.data['request_type']
record[:request_type] = record.data['request_type']