Trium918 Posted June 21, 2007 Share Posted June 21, 2007 As you can see, the session_start() is commented out. How come the session is being set still? <?php //session_start(); if($_POST['sublogin']){ $user_name = $_POST['user_name']; $password = trim($_POST['password']); $query = "SELECT * FROM members_info WHERE user_name='$user_name' AND password=MD5('$password') LIMIT 1"; if ($result = mysql_query($query)) { if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { $_SESSION['membersid'] = $row['members_id']; $_SESSION['last']= $row['last_visit']; if (isset($_SESSION['membersid'])) { echo "Session is set"; exit; } else{ echo "No";} #Display date as 5/8/2007 format $_SESSION['last']= date('n/d/Y', strtotime($_SESSION['last'])); $sql="UPDATE members_info SET last_visit=NOW() WHERE members_id='{$_SESSION['membersid']}'"; //now only update it $result2=mysql_query($sql); } } else { echo "No results found"; } } else { echo "Query failed<br />$query<br />" . mysql_error(); } } ?> Link to comment https://forums.phpfreaks.com/topic/56594-session-question/ Share on other sites More sharing options...
pikemsu28 Posted June 21, 2007 Share Posted June 21, 2007 is your session.auto_start enabled in your php.ini?? Link to comment https://forums.phpfreaks.com/topic/56594-session-question/#findComment-279494 Share on other sites More sharing options...
Trium918 Posted June 21, 2007 Author Share Posted June 21, 2007 is your session.auto_start enabled in your php.ini?? It is equal to 0 which means no, right? ; Initialize session on request startup. session.auto_start = 0 Link to comment https://forums.phpfreaks.com/topic/56594-session-question/#findComment-279497 Share on other sites More sharing options...
pikemsu28 Posted June 21, 2007 Share Posted June 21, 2007 It is equal to 0 which means no, right? ; Initialize session on request startup. session.auto_start = 0 Right! Link to comment https://forums.phpfreaks.com/topic/56594-session-question/#findComment-279542 Share on other sites More sharing options...
Trium918 Posted June 21, 2007 Author Share Posted June 21, 2007 So, what is setting the session? Do any of you have an idea? Link to comment https://forums.phpfreaks.com/topic/56594-session-question/#findComment-279544 Share on other sites More sharing options...
trecool999 Posted June 21, 2007 Share Posted June 21, 2007 Wow, that's a head scratcher... Last time I checked, when something is commented, it means don't do anything... Link to comment https://forums.phpfreaks.com/topic/56594-session-question/#findComment-279547 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.