aboutsummaryrefslogtreecommitdiffstats
path: root/gsxlib.php
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2011-05-03 20:32:36 +0300
committerFilipp Lepalaan <filipp@mac.com>2011-05-03 20:32:36 +0300
commit650cfad53a1e24e08d02eaead58893e39765e208 (patch)
tree984edf7f783ad749169877c5f3fe9db7af9445d9 /gsxlib.php
parent7a1f4b614c1552b34ddb23f2bdac089280175b5a (diff)
downloadgsxlib-650cfad53a1e24e08d02eaead58893e39765e208.tar.gz
gsxlib-650cfad53a1e24e08d02eaead58893e39765e208.tar.bz2
gsxlib-650cfad53a1e24e08d02eaead58893e39765e208.zip
Added getSessionId() to read the GSX user session ID
Diffstat (limited to 'gsxlib.php')
-rw-r--r--gsxlib.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/gsxlib.php b/gsxlib.php
index da5829c..055dd9b 100644
--- a/gsxlib.php
+++ b/gsxlib.php
@@ -72,7 +72,7 @@ class GsxLib
// there's a session going, put the credentials in there
if (session_id()) {
$_SESSION['_gsxlib_session_id'] = $this->session_id;
- $_SESSION['_gsxlib_session_timeout'] = time()+60*30;
+ $_SESSION['_gsxlib_session_timeout'] = time()+(60*30);
}
}
@@ -147,6 +147,17 @@ class GsxLib
}
+ /**
+ * return the GSX user session ID
+ * I still keep the property private since it should not be modified
+ * outside the constructor
+ * @return string GSX session ID
+ */
+ public function getSessionId()
+ {
+ return $this->session_id;
+ }
+
private function request($req)
{
$result = false;
@@ -158,7 +169,8 @@ class GsxLib
$result = $this->client->$r($request);
$resp = "{$r}Response";
return $result->$resp;
- } catch (SoapFault $e) {
+ }
+ catch (SoapFault $e) {
trigger_error($e->getMessage());
}