Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

uniqueginun's avatar

what's the difference between Sessions

Hello

What is the difference between Session Facade and Request session in general

// session facade
Session::put()

// request sessions
request()->session()->put();
0 likes
5 replies
Sinnbeck's avatar

In theory just 2 ways to get to the same place :)

The session facace calls the SessionManager which calls the Store class where the put() method exists

The request()->session() get the bound session class for the request (the Store class), where it calls put()

sr57's avatar

@MohamedTammam

Efficiency = ratio of utility versus energy consumed

  • utility is the same

  • what energy do you want to take in account ( workload to write, maintain, ... the code, ie investment, or energy to run the code) ? The answer to your question depends on this, but remember that we are speaking of some internal calls and the are MUCH MORE inefficiency in every codes even from the best dev of us. In fact in term of cpu usage a framawork (Laravel, ...) is inefficient, same for OOP :-)

1 like

Please or to participate in this conversation.