I'm working on a program dealing with cookies under the kohana's HMVC structure, and I find that Kohana has 3 ways to get/set the cookie. They are
Request::current()->cookie()
, Response->cookie()
, and the cookie class (Cookie::set(), get()
)
And PHP has a native setcookie()
function and $_COOKIE
to deal with cookies too.
Could anyone explain their differences and, what are the situations that they should be used respectively.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…