Page 1 of 1

[SOLVED]ManiaConnect issue.

Posted: 29 Dec 2014, 18:46
by Rots

Code: Select all

require_once '../mpws/libraries/autoload.php';
$mc = new Maniaplanet\WebServices\ManiaConnect\Player('user','pass');
$loginURL = $mc->getLoginURL('basic');
Is there something wrong with this? When I use the login url it succesfully authenticates but as soon as i refresh the page the authentication is gone. Before it never used to happen like this. Do I have to make some kind of session?

Re: ManiaConnect issue.

Posted: 29 Dec 2014, 19:02
by TMarc

Re: ManiaConnect issue.

Posted: 30 Dec 2014, 00:06
by Rots
Why does it behave like this now? Normally maniaconnect manages by itself a session, am I wrong?

Re: ManiaConnect issue.

Posted: 30 Dec 2014, 00:10
by TMarc
Perhaps they added some more security.
Or it was working for you only by luck or pure coincidence, some caches etc.

I think you always should have used the sessions to make it work properly.
But there is no clear word about it.

A search for the keyword 'session' shows e.g. this:
Buddies Scope Issue
getPlayer() with old token
ManiaConnect: invalid_grant random errors

Re: ManiaConnect issue.

Posted: 30 Dec 2014, 00:28
by Rots
Well then, examples in doc should be fixed or at least specify that session variables are managed by ourselves. Sorry, i'm a bit short on coding ^^ but I still don't get it... Does maniaconnect auth session expire on page refresh? Does this means I have to cache all data I want in one request to avoid reloging?

It's like If I had to put my username/password to post each time on the forums... no sense.

EDIT: Okay! I found the issue... maniaconnect session was interfering with an already started session that was loading before the authentication... My bad sorry :teub: I copypasted that piece of code before the previous session and it worked properly w/o errors.

(i wanst getting any php error... It was just a warning but enough to make mc session expire)