# Problem Logging in to site with two names

**URL:** <https://www.ruby-forum.com/t/problem-logging-in-to-site-with-two-names/170075>\
**Category:** Rails\
**Created:** [June 11, 2009, 11:33pm UTC](https://www.ruby-forum.com/t/problem-logging-in-to-site-with-two-names/170075 "2009-06-11T23:33:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 11, 2009, 11:33pm UTC](https://www.ruby-forum.com/t/problem-logging-in-to-site-with-two-names/170075/1 "2009-06-11T23:33:57Z")

</div>

I have a wierd website setup, because my boss doesn’t want to change  
who hosts our email server.

My website is hosted on site5, and has a domain name registered with  
them ([www.mysite1.com](http://www.mysite1.com)).  
[www.mysite2.net](http://www.mysite2.net) is registered somewhere else and resolves to  
[www.mysite1.com](http://www.mysite1.com).

When I try to login to [www.mysite1.com](http://www.mysite1.com) I have no problems.  
When I try to login to [www.mysite2.net](http://www.mysite2.net), I get an error from the  
verify\_authenticity\_token method.

I’m pretty sure I’m getting this because the session isn’t being  
loaded from the request, becuase I need to set some configuration in  
config.action\_controller.session = { in my environment.rb file.

I use :active\_record\_store

I’ve tried digging around in the abstract\_store.rb file to see if I  
could just hardcode something into the load! method so that it would  
make sure to load authenticity\_token from the request into the  
session.

def load!  
stale\_session\_check! do  
id, session = @by.send(:load\_session, @env)  
(@env[ENV\_SESSION\_OPTIONS\_KEY] ||= {})[:id] = id  
replace(session)  
@loaded = true  
end  
end

Any suggestions would be great.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 12, 2009, 5:31pm UTC](https://www.ruby-forum.com/t/problem-logging-in-to-site-with-two-names/170075/2 "2009-06-12T17:31:34Z")

</div>

I’m not entirely sure what you mean in your setup by “[mysite2.net](http://mysite2.net)  
resolves to [mysite1.com](http://mysite1.com)”. Depending on the setup, my first guess would  
be that your cookies aren’t getting resolved properly.

–Matt J.
