When OpenSRS says "cookie" they don't mean the HTTP kind of cookies you are
probably thinking about. :)

Basically, you authenticate as a domain/user, and OpenSRS gives you an
authentication string (cookie) that you use when trying to perform other
actions on the domain.  For example (using the PHP syntax) you authenticate:

        $O = new OpenSRS(...);

        $cmd = array(
            'action'        => 'set',
            'object'        => 'cookie',
            'attributes'    => array(
                'reseller_ip'   => '123.123.123.123',
                'domain'        => $domain
                'reg_username'  => $remote_user,
                'reg_password'  => $remote_pass
            )
        );

        $r = $O->send_cmd($cmd);
        $cookie = $r['attributes']['cookie'];

Then you do stuff, like get the WHOIS info:

        $cmd = array(
            'action'        => 'get',
            'object'        => 'domain',
            'cookie'        => $cookie,
            'attributes'    => array(
                'type'        => 'all_info'
            )
         );

        $r = $O->send_cmd($cmd);
        print_r($r['attributes']);

etc. ...

Hope that helps.

- Colin


----- Original Message -----
From: "Dave Baerg" <[EMAIL PROTECTED]>
To: "OpenSRS-dev" <[EMAIL PROTECTED]>
Sent: Friday, May 25, 2001 2:10 PM
Subject: PHP and Cookies


> This is a total newbie question but the documentation does not clearly
> discuss the cookie. I am using PHP  and the OpenSRS PHP Client by Colin
> Viebrock. I want to get Domain information on a user but cannot figure out
> where to get the cookie parameter from. I found the set, etc... cookie bu
no
> get.
>
> The nearest I can tell I get the cookie after authenticating the user. If
> this is the case what is the name of the cookie so I can retrieve it.
>
> What I would really appreciate is an explanation of what the cookie is and
> how to use it. A small sample application that includes getting
information
> on a domain would also be great.
>
> Thanks in advance for any help I can get.
>
> Cheers,
>
> Dave
>

Reply via email to