[SOLVED]ManiaConnect issue.

Maniaplanet public API, ManiaConnect system and the open source PHP SDK.

Moderator: NADEO

Post Reply
User avatar
Rots
Translator
Translator
Posts: 1165
Joined: 01 Sep 2010, 14:39
Location: España, Barcelona

[SOLVED]ManiaConnect issue.

Post 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?
Last edited by Rots on 30 Dec 2014, 01:04, edited 1 time in total.
Image
Image
Image
TrackMania Original brought me here... Here I am since 2006
User avatar
TMarc
Posts: 15441
Joined: 05 Apr 2011, 19:10
Location: Europe
Contact:

Re: ManiaConnect issue.

Post by TMarc »

User avatar
Rots
Translator
Translator
Posts: 1165
Joined: 01 Sep 2010, 14:39
Location: España, Barcelona

Re: ManiaConnect issue.

Post by Rots »

Why does it behave like this now? Normally maniaconnect manages by itself a session, am I wrong?
Image
Image
Image
TrackMania Original brought me here... Here I am since 2006
User avatar
TMarc
Posts: 15441
Joined: 05 Apr 2011, 19:10
Location: Europe
Contact:

Re: ManiaConnect issue.

Post 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
User avatar
Rots
Translator
Translator
Posts: 1165
Joined: 01 Sep 2010, 14:39
Location: España, Barcelona

Re: ManiaConnect issue.

Post 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)
Image
Image
Image
TrackMania Original brought me here... Here I am since 2006
Post Reply

Return to “Maniaplanet Web Services”

Who is online

Users browsing this forum: No registered users and 1 guest