PHP Session Handling (read function) Problem -


i have class handle session in code , store session data in db. in read callback function write query , load data db , return value when dump $_session empty!

i trace code , query corrent , data load not set session value. problem apear in subdomains session_id , cookie correct.

my read function code:

function read($session_id) {                   $result = @mysql_query("         select             session_data                     session_table                     session_id = '".$session_id."' ,             session_expire > '".time()."'     ");      if (is_resource($result) && @mysql_num_rows($result) > 0) {         $fields = @mysql_fetch_assoc($result);         return $fields["session_data"];     }           return "";      } 

my log:

read function log:              select                 session_data                             sessions_table                             session_id = '389dd7fc7bc19ffead7274c0ad860896' ,                 session_expire > '1295954400' read function result log: array (     [session_data] => corret serialized data )  write function log:                 update                     sessions_table                 set                     session_data = '',                     session_expire = '1295955840'                                     session_id = '389dd7fc7bc19ffead7274c0ad860896' 

don't use error supression operator (@). that's prevents seeing errors made in code. that's why don't know error in code. that's why have ask error in code.

actually, not see errors in code either, e.g. if database not set up correctly or there error in sql syntax, mysql_query tell that.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -