A
A
Alexander Kositsyn2018-02-05 21:35:16
JavaScript
Alexander Kositsyn, 2018-02-05 21:35:16

How, when clicking on a link, check if there is an administrator session, and if so, redirect to admin, and if not, then stay on the same page?

There is a link on the site Authorization
picture
The server is written in express.
When you click on the link, you need to check if there is an administrator session, if there is one without authorization (it appears if there is no session, this is not a new page, but a separate block that is initially hidden on the welcome page) redirect to the Admin and stop the handler on the link. If there is no administrator session, then execute the following code (it opens the block with the authorization form).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ainur Valiev, 2018-02-06
@alex_keysi

check by localStorage or cookie

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question