Got my redirect to work... something.cgi

X

Xeno Campanoli

require "#{ScriptLib}/CGIUtils.rb"

if $CGIo.has_key?('user_name') and $CGIo['user_name'] != '' then
#
## Add call to CVS Access validation here eventually.
#

un = $CGIo['user_name']

cookie = CGI::Cookie.new('user_name', $CGIo['user_name'])
STDERR.puts "trace cookie: #{cookie.to_s}"

header = $CGIo.header({'Status' => '302 Moved', 'location' =>
'http://hyhost/index.rhtml'})
$CGIo.out( 'cookie' => cookie, 'header' => header ) { "Session
started..." }
else
$CGIo.out { "You have not been allowed access to this BARY resource." }
exit 0
end
---snip---
I still haven't figured out how you would do this with .rhtml, but it's
not really necessary. The really interesting and helpful thing would be
to make eruby put up the cookie if has or eventually gets a method or
set of methods to do so.

Thanks all though for the feedback.

xc
 
X

Xeno Campanoli

Xeno said:
require "#{ScriptLib}/CGIUtils.rb"

if $CGIo.has_key?('user_name') and $CGIo['user_name'] != '' then
#
## Add call to CVS Access validation here eventually.
#

un = $CGIo['user_name']

cookie = CGI::Cookie.new('user_name', $CGIo['user_name'])
STDERR.puts "trace cookie: #{cookie.to_s}"

header = $CGIo.header({'Status' => '302 Moved', 'location' =>
'http://hyhost/index.rhtml'})
$CGIo.out( 'cookie' => cookie, 'header' => header ) { "Session
started..." }
else
$CGIo.out { "You have not been allowed access to this BARY resource." }
exit 0
end
---snip---
I still haven't figured out how you would do this with .rhtml, but it's
not really necessary. The really interesting and helpful thing would be
to make eruby put up the cookie if has or eventually gets a method or
set of methods to do so.

Thanks all though for the feedback.

xc
Oddly, the cookie I see in my browser isn't readable by default from the
redirected to point. Presumably I need a path or something...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,663
Latest member
josh5959

Latest Threads

Top