B
B
bedolazhka2019-11-25 21:24:13
PHP
bedolazhka, 2019-11-25 21:24:13

How to logically organize the control of the authorized?

Well, I set up a session and check if it exists, load a different template there by condition, put it into a common controller, the rest are inherited from it.
Well, I’m in some kind of controller, and the session died and the template changed, but the view remained))) I need some kind of initial redirect, and if I closed the browser and open it at the initial one and is authorized, then I the site needs a redirect from it too)
So far, I've come up with a common controller (so that each controller does not check the session) to check the session and whether the current controller corresponds to the presence of the session.
Can someone tell me a simple material on retaining an authorized person? On the OOP.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2019-11-25
@bedolazhka

Each request of an authorized person to any page - check the sent cookies (session id and authorization token) and renew them. Then the session will not suddenly die in the middle of script execution and the problem will disappear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question