3
Today I use the following code to start a PHP Session
//verificação se o id de sessão ja existe, se não existir, cria
if (!session_id()){
// iniciando a sessão
session_start();
// buffer para evitar o erro ao acionar o headlocation
ob_start();
}
As I am new in PHP, I would like to know... Do I need to make additional settings to avoid future access problems? that is, I want to prevent the site I developed from getting overloaded.
I also realized that the session is only finished when I close the browser, what is the expiring time of the php session and it is necessary to change this?
Tips?
I’m using version 5.6
The session is not something that has a great impact on the server’s performance, what messes with large-scale performance that if not taken care of gives problem is the use of the database and unbridled use without need and without any test table loops.
– Renato Junior
then I created classes and Pdo and foreach for the links (I open a single connection) to get the page information. By the tests I’ve done everything works normally, as would these table tests you spoke of?
– Diego Lela
See how to do table test at this link
– Renato Junior
This code itself has no problem, the problems may come is in handling the session, at the time of adding values and removing, the above code only starts the session and nothing else.
– Guilherme Nascimento
I understand, but what about the requisition part? every time someone visits the site, there will be a correct request? how do I know the stipulated limit?
– Diego Lela