2009/6/9 Beebe, Mary J <[email protected]>:
> It is showing anonymous:
> <userinfo id="0" name="131.167.170.97" anon="" />
>
> In http://www.mediawiki.org/wiki/API:Login
>
> Under "Constructing Cookies Manually" it says
> "A successful action=login request will set the right cookies."  But I am 
> trying to construct my own cookies following the information below that.
>
> I have these cookies:
> defaultdb_session
> defaultdbToken
> defaultdbUserID
> defaultdbUserName
>
> The cookies are under localhost.  Could that be a problem?
>
> I also see: "the cookie set by this request must be passed."  I am not 
> passing anything.
>
What you have to do is get the cookies that action=login is giving you
and send them back as part of your HTTP request on all subsequent
queries. If you're somehow unable to grab the cookies, you can build
them manually as outlined in the docs, but you still have to include
them in every HTTP request. The framework you're using to do HTTP
requests probably has a way to set cookies; for instance, in Snoopy
(an HTTP framework for PHP), it's as simple as calling
$snoopy->setCookies(); after the login request, which automatically
grabs the cookies received in the previous request and passes them in
every subsequent request. Your framework probably has a setCookie() or
similarly-named function as well.

Roan Kattouw (Catrope)

_______________________________________________
Mediawiki-api mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

Reply via email to