Friday 15 April 2011

PHP session not destroying or unsetting -



PHP session not destroying or unsetting -

i have next php code checking login in index.php

<?php session_start(); $con = mysqli_connect("***", "***", "***", "***"); $fbid_check=$_session['loginid_session']; $fbphoto_session=$_session['loginphoto_session']; $fbname_sql=mysqli_query($con, "select fb_name uni_users fb_id='$fbid_check' "); $name_fetch=mysqli_fetch_array($fbname_sql, mysqli_assoc); $fbname_session=$name_fetch['fb_name']; if(isset($fbname_session)) { header("location: http://www.uniwink.com/landing/profile.php"); } mysqli_close($con); ?>

this checks login , redirects profile.php has next php code in header check login

<?php $con = mysqli_connect("****", "****", "****", "****"); session_start(); $fbid_check=$_session['loginid_session']; $fbphoto_session=$_session['loginphoto_session']; $fbname_sql=mysqli_query($con, "select fb_name uni_users fb_id='$fbid_check' "); $name_fetch=mysqli_fetch_array($fbname_sql, mysqli_assoc); $fbname_session=$name_fetch['fb_name']; if(!isset($fbname_session)) { header("location: http://www.uniwink.com/landing"); } mysqli_close($con); ?>

and have next logout.php called profile.php

<?php session_start(); unset($_session['loginid_session']); unset($fbname_session); session_destroy(); header("location: http://www.uniwink.com/landing"); exit(); ?>

the problem after logout, still goes profile.php . if session not destroyed @ all. thing working until yesterday , happened of sudden. thanks

check session.

if (isset($_session['loginid_session'])) { header("location: http://www.uniwink.com/landing/profile.php"); } else { header("location: http://www.uniwink.com/landing"); }

php session web login session-variables

No comments:

Post a Comment