Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
CGI::Session not sending cookie
zak.wilson
12/28/2007 7:03:00 AM
I'm using mod_ruby, eruby and CGI::Session in an application. It seems
that the cookie is never being sent, and I have no idea why. Here's a
simple rhtml file illustrating the problem:
% require 'cgi'
% require 'cgi/session'
% require 'cgi/session/pstore'
% cgi=CGI.new()
% sess=CGI::Session.new(cgi, 'database_manager' =>
CGI::Session::PStore, 'session_key' => 'hello_session')
<% sess['visits'] ||= 0 %>
<%= sess.session_id %>
<%= sess['visits'] %> visits
<% sess['visits'] += 1
sess.close%>
Each time this is loaded, no cookie is set, so no session ID is sent
back to the page on reload and a new session is started each time.
This behavior does not match any of the documentation I've been able
to find, but it does match what's described in
http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/84a1bddd046a9b66/d6d7e7...
The above poster solved his problem by passing around the session ID
as a query parameter, but that seems to miss the point of using
CGI::Session. Am I missing something obvious here?
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
CGI::Session not sending cookie
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password