Ask coding questions

← Back to all posts
How do i access data from outside the public folder
ike_fite (12)

I'm making a website and I want to put the admin folder out of the public directory. (for obvious security reasons) I don't know how to do that. My guess is that I'm going to have to do that on the server-side, but I need some help.


Answered by Coder100 (18175) [earned 5 cycles]
View Answer
Coder100 (18175)

well, the thing is, how you are doing this is incorrect. You are right now just blindly hosting it on the website without having any check of any cookies.

ike_fite (12)

But how do I do a cookie check without having to worry about "inspect element hackers" for a lack of a better term. I will also run into issues if they turn off cookies. @Coder100

Coder100 (18175)

@ike_fite oh, by like basically assigning admins a secret key in your .env only you know about

Coder100 (18175)

so yes, people can change cookies, but remember you are only checking cookie value, and if it doesn't exist it won't affect that @ike_fite

ike_fite (12)

The problem with using env files is I'm going to host this elsewhere @Coder100
Edit: After I sent this I realized that if I deal with cookies on server-side I won't run into this issue.

Coder100 (18175)

when you are going to host this elsewhere, still put the key in some file you won't commit so then you don't accidentally reveal it. @ike_fite

GarySmith5 (0)

Is there an "ideal software development project," and, provided that this is true, what are steps you should take to accomplish this ideal. There are exacting rules and diverse software development best practices approaches like scrum or outrageous programming, you can discover in this blog

anastefanyuk (0)

Hello! Well, this is quite a task I guess, so if you are still looking for a solution, I think this article might be quite helpful for you. If this helps, give feedback please, it will be much appreciated.

Chewyblockguy (9)

I recomend checking out this link be careful as it has no moderated chat. thats for the inspecting. for the rest just do <script src="></script> to embed it for more privacy you should just upgrade to hacker and make it a private repl.