Cant login after SESSION check

djsaders

New Member
I have the website pages for visitors and the pages for the client manage it on /adminI created a login system at admin/index.php and it's working fine. But, if I type the url of an admin page in the browser (e.g admin/carro_admin.php) I get access even without been loged. So I'm trying to put some session check on this page (carro_admin) to block visitors and allow just login access.I trying to do that with:\[code\]if (isset($_SESSION)) { header("location:carro_admin.php"); }else { header("location:index.php"); }exit();\[/code\]It's blocking the access and sending me to index.php (and that's right). But now the login system doesn't work. When I type my username and password I'm redirected to index.php again.Is something wrong with my session code?Ps.: I already read this question: How to set and check a session after login? but it didn't work too.
 
Top