small problem about retrieving variable from SESSION‏

李辰 <[email protected]> Mon, 20 Aug 2012 12:41:47 +0800
Newsgroups gmane.mail.squirrelmail.devel
Message-ID <[email protected]>
Hi, all,
I am new to Squirrel mail and not sure if this is the right place to ask questions. In a research project, I need for some reason to modify the sm code. Specifically, I need to modify the right_main.php, so that each time when I click "inbox" it will not call sqimap_login() again if we already have one imap session remaining. I do not logout from imap explicitly.   Only the first time we need to create a imap connection. My problem is, with the below code(the output followed), I cannot get back the imapConnection when I click inbox or simply refresh the page. 

Any suggestions? Thanks very much.

/* Open a connection on the imap port (143) */global $imapConnection;//var_dump("$username");//var_dump("$imapConnection");sqgetGlobalVar('imap',$imapConnection,SQ_SESSION);echo "Before: "; var_dump("$imapConnection");echo "<br />";//echo "Before: $imapConnection <br />";
if(empty($imapConnection)) {     $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);     sqsession_register($imapConnection,'imap');     sqgetGlobalVar('imap',$imap,SQ_SESSION);//check if I've put imap connection descriptor  to SESSION successfully.     var_dump("$imap");     }echo "After:"; var_dump("$imapConnection");

 The output is : 
Before: string(1) "0" string(15) "Resource id #65" After:string(15) "Resource id #65"

Regards,Jerry

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel