diff -rupN redmine-2.2.3/app/controllers/account_controller.rb it-redmine/app/controllers/account_controller.rb --- redmine-2.2.3/app/controllers/account_controller.rb 2013-02-12 11:54:17.000000000 -0800 +++ it-redmine/app/controllers/account_controller.rb 2013-03-01 23:01:04.642760286 -0800 @@ -169,7 +169,8 @@ class AccountController < ApplicationCon end def open_id_authenticate(openid_url) - authenticate_with_open_id(openid_url, :required => [:nickname, :fullname, :email], :return_to => signin_url, :method => :post) do |result, identity_url, registration| + authenticate_with_open_id(openid_url, :required => [:nickname, :fullname, :email], :return_to => signin_url(:autologin => params[:autologin]), :method => :post) do |result, identity_url, registration| + if result.successful? user = User.find_or_initialize_by_identity_url(identity_url) if user.new_record? @@ -223,7 +224,6 @@ class AccountController < ApplicationCon def set_autologin_cookie(user) token = Token.create(:user => user, :action => 'autologin') - cookie_name = Redmine::Configuration['autologin_cookie_name'] || 'autologin' cookie_options = { :value => token.value, :expires => 1.year.from_now, @@ -231,7 +231,7 @@ class AccountController < ApplicationCon :secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false), :httponly => true } - cookies[cookie_name] = cookie_options + cookies[autologin_cookie_name] = cookie_options end # Onthefly creation failed, display the registration form to fill/fix attributes diff -rupN redmine-2.2.3/app/controllers/application_controller.rb it-redmine/app/controllers/application_controller.rb --- redmine-2.2.3/app/controllers/application_controller.rb 2013-02-12 11:54:17.000000000 -0800 +++ it-redmine/app/controllers/application_controller.rb 2013-03-01 22:56:16.730748635 -0800 @@ -32,7 +32,7 @@ class ApplicationController < ActionCont protect_from_forgery def handle_unverified_request super - cookies.delete(:autologin) + cookies.delete(autologin_cookie_name) end before_filter :session_expiration, :user_setup, :check_if_login_required, :set_localization @@ -124,10 +124,14 @@ class ApplicationController < ActionCont user end + def autologin_cookie_name + return Redmine::Configuration['autologin_cookie_name'] || 'autologin' + end + def try_to_autologin - if cookies[:autologin] && Setting.autologin? + if cookies[autologin_cookie_name] && Setting.autologin? # auto-login feature starts a new session - user = User.try_to_autologin(cookies[:autologin]) + user = User.try_to_autologin(cookies[autologin_cookie_name]) if user reset_session start_user_session(user)