Page 1 of 1

Session key is expired? balance doesn't work online?

Posted: Tue Jan 27, 2015 4:34 pm
by kingprado
Hi.

I've tried 10 times but no result on session key matter... I do use AccountsSessionKey API command to produce the session key but its not working(its safe in php codes but there is no use for it ) it says Expired and we don't see session key in Address bar.

( We got the session key in address bar once but again we got It's Expired , so we tried to use another way but again Expired!)

my result code in play.php is <iframe height="900px" width="100%" src="http://5.39.118.163/?LoginName=king&Ses ... "></iframe> but its not working.
---------------------

Second question is about balance and ringchips ( I've made a paragraph which show Balance RingChips total in Play.php page , but is;s just working when we come to play.php and its not showing online results , How Can I make it show online result and do refresh ?

What's the main problem here?


Best Wishes

Re: Session key is expired? balance doesn't work online?

Posted: Tue Jan 27, 2015 5:02 pm
by Kent Briggs
kingprado wrote:it says Expired and we don't see session key in Address bar.
A session key can only be used once for a login. If you try a second time or refresh your browser, it will return the expired message.
but is;s just working when we come to play.php and its not showing online results , How Can I make it show online result and do refresh ?
This is all your custom code, which you didn't show. So, impossible to say what the issue is.

Re: Session key is expired? balance doesn't work online?

Posted: Tue Jan 27, 2015 5:52 pm
by kingprado
Kent Briggs wrote:
kingprado wrote:it says Expired and we don't see session key in Address bar.
A session key can only be used once for a login. If you try a second time or refresh your browser, it will return the expired message.
but is;s just working when we come to play.php and its not showing online results , How Can I make it show online result and do refresh ?
This is all your custom code, which you didn't show. So, impossible to say what the issue is.

Kent but I saw another poker web sites that their session key is always up ( I mean for that time which you are online and if you close the browser it will not work but if you close the poker maven's it self in play.php so if you refresh your browser you will again can play the game )...


About balance My mean was that our balance showing section is just like a static section and it doesn't refresh it self while a player is winning and losing ! that's My mean.

Thank you Kent.

Re: Session key is expired? balance doesn't work online?

Posted: Tue Jan 27, 2015 6:18 pm
by Kent Briggs
kingprado wrote:Kent but I saw another poker web sites that their session key is always up ( I mean for that time which you are online and if you close the browser it will not work but if you close the poker maven's it self in play.php so if you refresh your browser you will again can play the game )...
Then they probably have code on that page that is creating a new session key.
About balance My mean was that our balance showing section is just like a static section and it doesn't refresh it self while a player is winning and losing ! that's My mean.
Then you would need to write code using a timer, ajax, websocket, or some other technique to communicate with your web server.

Re: Session key is expired? balance doesn't work online?

Posted: Fri Jan 30, 2015 5:08 am
by kingprado
these are my codes in api.php for log in and session key :

function logIn($user, $password)
{
global $_SESSION, $_CONFIG;
$params = array("Command" => "AccountsPassword", "Player" => $user, "PW" => $password);
$api = Poker_API($params);
if ($api->Result != "Ok")
createErrorPage($api->Error . "<br/>" . "Click Back Button to retry.");
if ($api->Verified != "Yes")
createErrorPage("Password is incorrect. Click Back Button to retry.");
$params = array("Command" => "AccountsSessionKey", "Player" => $user);
$api = Poker_API($params);
if ($api->Result != "Ok")
createErrorPage($api->Error . "<br/>" . "Click Back Button to retry.");
$key = $api->SessionKey;

$src = $server . "/?LoginName=" . $player . "&SessionKey=" . $key;

$_SESSION['logged_in'] = "yes";
$_SESSION['username'] = $user;
$_SESSION['session_key'] = $key;
@ob_clean();
header("Location: ./Index.php");
exit(0);

return 1;
}

so after use login form to register $_session in server i use session variable in play.php in this case:

<?php
echo '<iframe height="900px" width="100%" src="';
echo $_CONFIG['Server'] . "/?LoginName=" . $_SESSION['username'] . "&SessionKey=" . $_SESSION['session_key'];
echo '"></iframe>';
?>

whats and where my wrong help me plz

Re: Session key is expired? balance doesn't work online?

Posted: Fri Jan 30, 2015 10:34 am
by Kent Briggs
One issue I see is that your code continues to run after you detect any errors. I don't know what your createErrorPage() function is doing but the script keeps running after that instead of aborting right there. Later on you are setting a $src variable but then never using it again after that. At the end you have a return command immediately following an exit.

Re: Session key is expired? balance doesn't work online?

Posted: Mon Feb 02, 2015 4:27 pm
by kingprado
Kent I think there is no problem with these code and we once call session key and then we put it in global variable part...

Re: Session key is expired? balance doesn't work online?

Posted: Wed Feb 04, 2015 2:47 am
by kingprado
Kent What do we have to do now? Our player can not reload play.php page while they got disconnected...

;)

Re: Session key is expired? balance doesn't work online?

Posted: Wed Feb 04, 2015 10:12 am
by Kent Briggs
kingprado wrote:Kent What do we have to do now? Our player can not reload play.php page while they got disconnected...
You probably need to hire a better programmer. Sorry, I don't have time to debug other people's code.