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

For general discussion of the Poker Mavens software

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

Postby kingprado » Tue Jan 27, 2015 4:34 pm

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&amp;SessionKey=E6195C72D71C8C0EBF80"></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
kingprado
 
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

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

Postby Kent Briggs » Tue Jan 27, 2015 5:02 pm

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 Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3826
Joined: Wed Mar 19, 2008 8:47 pm

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

Postby kingprado » Tue Jan 27, 2015 5:52 pm

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.
kingprado
 
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

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

Postby Kent Briggs » Tue Jan 27, 2015 6:18 pm

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.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3826
Joined: Wed Mar 19, 2008 8:47 pm

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

Postby kingprado » Fri Jan 30, 2015 5:08 am

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'] . "&amp;SessionKey=" . $_SESSION['session_key'];
echo '"></iframe>';
?>

whats and where my wrong help me plz
kingprado
 
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

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

Postby Kent Briggs » Fri Jan 30, 2015 10:34 am

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.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3826
Joined: Wed Mar 19, 2008 8:47 pm

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

Postby kingprado » Mon Feb 02, 2015 4:27 pm

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...
kingprado
 
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

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

Postby kingprado » Wed Feb 04, 2015 2:47 am

Kent What do we have to do now? Our player can not reload play.php page while they got disconnected...

;)
kingprado
 
Posts: 24
Joined: Sun Nov 09, 2014 11:49 pm

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

Postby Kent Briggs » Wed Feb 04, 2015 10:12 am

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.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3826
Joined: Wed Mar 19, 2008 8:47 pm


Return to General

Who is online

Users browsing this forum: No registered users and 9 guests

cron