API to increase Hotspot http-cookie-lifetime

Hi guys,

Just wondering is it possible to use a form to increase the Hotspot http-cookie-lifetime via input field

I am using below code but no joy with it.

===Form Code===

Submit

=====cookie.php Code====

<?php // Receiving variables @$logincookie = addslashes($_POST['logincookie']); use PEAR2\Net\RouterOS; require_once 'PEAR2/Autoload.php'; $util = new RouterOS\Util( $client = new RouterOS\Client('192.168.88.1', 'admin', 'password') ); $util->setMenu('/ip hotspot profile set hsprof1'); $util->edit(0, 'http-cookie-lifetime', $_POST['logincookie']); \ \ header('Location: index.php'); ?>



Anyone have any solutions or ideas?

I’m pretty sure “set hsprof1” is not a menu.

I’m guessing that’s the name of the profile, so:

$util->setMenu('/ip hotspot profile');

$util->edit('hsprof1', 'http-cookie-lifetime', $_POST['logincookie']);

Hi boen_robot,

That worked like a charm, thank you!