Develop multi-user areas for LuCI

I've contacted Jow. This is your answer:

The index procedure of a controller file is cached as bytecode and executed from cache on subsequent page invocations. This means you cannot access local functions.

Make your get_username_session function non-local and in your index() procedure do the following:

function index()
    local ctrl = require 'luci.controller.admin.test'  -- must correspond to the controller path
    local foo = ctrl.get_username_session()

    -- ...
end

Now I've fixed file test.lua and this is the link --> https://drive.google.com/open?id=1-B9zgZBjnAzyCJnM0qMKmxlG17gpXzjc

replace this file and test it!
Bye

1 Like