Powered by SmartDoc

Getting cookies from a request object

CKRequest has some methods for getting cookies. The methods are cookie(key), cookies, cookie_value(key), cookie_values(key). You can get CKRequest objects by CKApplication#request.

Getting cookies methods of CKRequest
Method Description
cookie(key) Returns a CKCookie object whose keyis the same as the argument.
cookies Returns an array of CKCookie objects.
cookie_value(key) Returns the value of CKCookie object whose keyis the the same as the argument.
cookie_values(key) If the argument is nil(by default, argument is nil.), this method returns an array which has all the values of cookies. Otherwise, it returns an array which has the values of cookies specified by the argument.