Write the session data cookie if it was loaded and has changed.
# File actionpack/lib/action_controller/session/cookie_store.rb, line 108
def close
if defined?(@data) && !@data.blank?
updated = marshal(@data)
raise CookieOverflow if updated.size > MAX
write_cookie('value' => updated) unless updated == @original
end
end