check whether a particular session exists or not
how can i check whether a specified/particular session exists or not.
i.e.
setting session - session_id('xxx');
checking 'sess_xxx' exist or not - if(isset(session_id($userid)))
i have used following script but it gives error at line 12 (if(isset(session_id($userid)))
<?php
mysql_connect ("localhost", "game_cvg", "cvg") or die ('cannot connect : ' . mysql_error());
mysql_select_db("game_accounts") or die ('cannot select database because: ' . mysql_error());
$userid = $_GET['$userid'];
$password = $_GET['$password'];
$result = mysql_query("select session from accounts where userid='$userid'");
$row = @mysql_fetch_assoc($result);
echo $row["session"];
session_id($userid);
if(isset(session_id($userid))){
echo 'You are already logged in';
}
else{
echo 'You are allowed to log in';
}
session_start();
echo session_id();
?>
chayan vinayak goswami
__________________
chayan vinayak goswami
|