PHP Sessions and Cookies set up <p>I want to learn something, that I couldn't find on the internet. I create a simple website, more like a simple web app, we the following structure.</p> <pre><code>index.php --&gt; handles log In or Register home.php --&gt; main state of website. </code></pre> <p>So basically I want when a user log in, the website will direct him to <code>home.php</code>. I did it already. But I get a really annoying bug. If I redirect bruteforce in <code>www.someexample.com/home.php</code>, the user can bypass the main log in screen. O.o<br> So I thought that if I can use a session checker to see if the user is log in or just a brute forcer -sorry about the bad term- the website will redirect him to log in screen. And if the user don't want every time to log in he can check a <code>Remember me</code> button to remember the session. So in the end I want to have two methods. one to check if a user is log in or not and the other to save his session even after if he close the computer until he poush the log out button.</p> <p>I have checked many articles on the web but I couldn't find how to start in my own project. Can you guys help me start of with a basic structure. i use MySql.</p>