-> No it's not - well it's YOUR prefered method.
-> Just checking to see if a session var called $_SESSION['username'] exists is pretty poor security.
correction.
it looks that at least 2 people in only this topic
thinks it is a good enough
which should make it many other, too
for most personal homepages with a limited number of users
I also think it will do nicely
for increased security we could add several session variables
that should match
now if you run a big business, a bank, a military or a governement website
surely it is a very bad way to protect pages
those into such security needs are probably not lerning
to write php here
they have professional applications and programmers
to do their stuff
but very few of us are into such serious stuff
and for most it wouldnt be the end of world if a page was read
and think the chance anyone would bother to try
and should manage to make a successful break in
in a simple session check
is not very high
I wouldnt worry too much
🙂