Class: Utils

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/express_translate/base_controller.rb

Class Method Summary collapse

Class Method Details

.getCookie(string, key) ⇒ Object

Get cookie form header action



13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/express_translate/base_controller.rb', line 13

def self.getCookie(string, key)
  if string.present?
    string.split(";").each do |cookie|
      cookie.strip!
      _cookie = cookie.split("=")
      if _cookie[0] == key
        return _cookie[1]
      end
    end
  end
  return ""
end