Net:HTTP with authentification?

hey ,

below an example of a code

url = URI.parse(‘http://www.example.com/todo.cgi’)
req = Net::HTTP:: Post.new(url.path)
req.basic_auth ‘jack’, ‘pass’
req.set_form_data({‘from’=>‘2005-01-01’, ‘to’=>‘2005-03-31’}, ‘;’)
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req)
}

i use this code to get a component of a local page (different
controller )

example : from home/index send a request to products/list

to send a request i need a password but i dont know how to get it ,
how to decrypt it

is there another way to loggin without login and password , with session
or cookies in the request header for exampe

thnx