#482 √ resolved
hampsterx

add domain to session option

Reported by hampsterx | September 18th, 2008 @ 10:52 AM

(first post be gentle)

Inside init.rb I want to be able to use

Merb::Config.use do |c|

... c[:session_domain] = ".localhost.com"

end

This allows you to write applications on subdomains that piggy back the domain session. php equivalent is..

ini_set("session.cookie_domain", '.localhost.com');


I modified session.rb with the following

base._session_domain = Merb::Config[:session_domain]

cookies.set_cookie(session_id_key, value, { :expires => Time.now + session_expiry, :domain => _session_domain }.merge(options))

works fine..

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »