D
D
ds00lon2015-10-24 04:13:07
PHP
ds00lon, 2015-10-24 04:13:07

From where does the script get information faster, from sessions or from the database?

The question is, where is the fastest way to get the data of the user who is logged in.
In the script, you constantly need to use its login and its settings (5-8 variables).
Should they be inserted into the php session when the user logs in, or should they be taken from the database with each request?

  1. Which option is faster?
  2. What option would you recommend?
  3. Why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2015-10-24
@ds00lon

If sessions are stored in memcache or mode then this is the fastest option. From files very slowly as well as from a DB. who gives advice about the database is Pinocchio

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question