php - How to prevent directly accessing assets on a site that requires authentication? -
The company's site is written in PHP, but runs on IIS7.
Status: An unverified user follows a bookmark or manually enters the URL of a page. The user should be redirected to sign in, if they are not already. Current status This works, but only for PHP pages. Each page contains a code that checks for the active session and if no one is found, the user is taken to the sign in page. The problem that needs to be addressed is: If the user enters a bookmark or a URL of a property manually that is not a page (an icon in the page, an excel Document, an image, a PDF, etc.), we want the user to be redirected to sign in. / P> How do we check an active session when the user accesses non-PHP assets directly? In other words, how do we check an active session for the URL like this: ? Not sure about IIS, can help with Apache, but uh .. I The social network address that links to its fixed assets via PHP. Therefore, an image link will not be direct, but: /getImage.php?id=secretimage and there you can check the first session ... but yes, your The case requires some refactoring.
Comments
Post a Comment