Hello,

I am making an SSO-like system based on the Roundcube connection and would like to check from a Ruby on Rails App that the user is logged in Roundcube. I have tried to make a HTTP GET request from my Rails app and checking for the existance of the login form on the index.php page.

Here's my rails code

        require 'net/http'     
           
        url = URI.parse('http://www.mysite.com/dir1/index.php')
        req = Net::HTTP::Get.new(url.path)
        res = Net::HTTP.start(url.host, url.port) {|http|
                http.request(req)
        }

        reg = /<div id="login-form">/
        logged = reg.match(res.body) ? false : true

even though a user is connected in Roundcube my get keep returning the login page.
Where am I mistaken ? Or does anyone have a better way of doing this ?

Thank you for your help.