static public Method

PStore.new(session, option={})

There's no documentation for this item.

Source Code

# File action_controller/cgi_ext/session.rb, line 51
def initialize(session, option={})
  dir = option['tmpdir'] || Dir::tmpdir
  prefix = option['prefix'] || ''
  id = session.session_id
  md5 = Digest::MD5.hexdigest(id)[0,16]
  path = dir+"/"+prefix+md5
  path.untaint
  if File::exist?(path)
    @hash = nil
  else
    unless session.new_session
      raise CGI::Session::NoSession, "uninitialized session"
    end
    @hash = {}
  end
  @p = ::PStore.new(path)
  @p.transaction do |p|
    File.chmod(0600, p.path)
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.