Authorization in php, without further saving the password and login, which is a connection to the Oracle database

62 views Asked by At

Modeling the situation: The user enters his login and password in the form on the auth.php page, the data is sent,

new ConnectToDB($user,$password) 

happens, he is authorized and redirected to the example.php page On which the select request to the database occurs through the

new ExampleModel($dbConnect)

instance, $dbConnect must have a connection to the database obtained from the auth.php page similarly on other pages

I experienced: storage of connections in sessions; connection storage in pseudo-globally install; storing them in a separate facility; create SessionManager; and other options Caused connection = null on new pages, or oci8 resource could not be passed

1

There are 1 answers

0
symcbean On

You can't pass resources between http requests in PHP - each HTTP request starts PHP with a blank canvas. You need to persist the username and password in the session and reconnect in each script.