Why session is not destroyed, after i destroy it in my logout.php page? -


i have started session (session_start()) in file included in pages. link logout.php in file, ll post code included file later, code logout.php page.

after logout, ok, if click more 2-3 times on admin button (which should active if $_session['user1'] , $_session['pass'] r correct) proceed admin.php page (after destroyed session o.o);

part of included file pages:

<?php session_start();      if ((!isset($_session['user1']))&&(!isset($_session['pass1'])))  {             echo "<li><a href='login.php'>admin</a></li>";     }      else {             echo "<li><a href='admin.php'>admin</a></li>";     };  ?> 

logout page:

<?php session_start(); unset ($_session['user1'],$k); unset ($_session['pass'],$p); session_destroy(); header('location:naslovna.php'); exit(); ?> 

as per documentation:

session_destroy() destroys of data associated current session. not unset of global variables associated session, or unset session cookie. use session variables again, session_start() has called.

if want destroy session, have unset session cookie yourself.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -