What is the difference between the Session::set
and Session::put
methods in Laravel? The docs only covers Session::put
, but I have seen set
used instead.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
They are exactly the same. Session::put
directly calls Session::set
.
The only difference, is that Session::put
allows you to pass it an array of [key => value]
pairs, in which case it calls Session::set
for each of them.
These methods are defined in Illuminate\Session\Store