So for instance, the consumer is signing in, and also the product is storing informations about the subject example: birth date, same with faster to obtain these details in the session, in order to query the database for this?

My idea was, the user must login only once and also the session is definitely there, but when I query the database, then when the user reloads the page, the machine must query over and over, rather than obtaining the data from the temporary 'place'.

I personally use PHP and MySQL.

For every language and database, yes. A person session is generally just saved in memory, and becoming a your hands on it's really a few searching up. A database access usually involves some socket communication having a different process. Rather heavy in contrast.

How's it going doing the work all? The best way to do is to determine the user qualifications in the login page company there you have to create a query to see if the consumer specified criteria match within the database. When they do, you store them in session and you continue according to that session.

So, it's not about comparison, make to question the database once in the login page and employ session later on.

Login Page

// database query run once only at this page
// if user exits, you store it into session else redirect with an error message

Really, Carl's response is not fully correct, and saying "MySql" does not help either.

The thing is, database systems like mysql have "storage engines". These usually email files, but you will find some which email memory (MEMORY), others write memory but have a file backup (MyISAM) along with a couple of to /dev/null (BLACKHOLE).

Therefore it all is dependent around the storage engine:

  • MyISAM - Default engine by MySQL 3.23 with great performance
  • MEMORY - Hash based, saved in memory, helpful for temporary tables
  • InnoDB - Supports transactions, row-level securing, and foreign secrets
  • BerkeleyDB - Supports transactions and page-level securing
  • BLACKHOLE - /dev/null storage engine (whatever you email it vanishes)
  • EXAMPLE - Example storage engine
  • ARCHIVE - Archive storage engine
  • CSV - CSV storage engine
  • ndbcluster - Clustered, fault-tolerant, memory-based tables
  • FEDERATED - Federated MySQL storage engine
  • MRG_MYISAM - Assortment of identical MyISAM tables
  • ISAM - Obsolete storage engine

(list from PhpMyAdmin Egines list)