Have you looked at CallPHP library by David Beck? I came across this library sometimes ago and it helped me.
Here is a description of the library culled from the website:
"CallPHP enables a LiveCode script to easily call PHP functions on a remote server and have values returned to it from the PHP functions. CallPHP is very easy to use. Here is an example of how CallPHP can be used from a LiveCode script to call a PHP function on a remote server that adds two numbers together:
put callPHP_Call( "AddNumbers", 3, 4 ) into callPHPRes
put callPHP_GetResult( callPHPRes ) into theResult
-- theResult now contains 7
http://www.rotundasoftware.com/livecode/
The session variables can be called from (a) function(s) as described above after installing the library.