# Acts\_as\_authenticated strangeness

**URL:** <https://www.ruby-forum.com/t/acts-as-authenticated-strangeness/85116>\
**Category:** Rails\
**Created:** [February 10, 2007, 3:54am UTC](https://www.ruby-forum.com/t/acts-as-authenticated-strangeness/85116 "2007-02-10T03:54:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [February 10, 2007, 3:54am UTC](https://www.ruby-forum.com/t/acts-as-authenticated-strangeness/85116/1 "2007-02-10T03:54:30Z")

</div>

hi  
the strangest thing is happening. on my local machine  
acts\_as\_authenticated works fine, but whe on the server [dreamhost] it  
refuses to log in. no error messages. nothing. just reloads the login  
page again.

here`s my action:

def login  
return unless request.post?  
flash[:notice] = “Incorrent login”  
self.current\_user = User.authenticate(params[:login],  
params[:password])  
if logged\_in?  
session[:username] = params[:login]  
user=User.find\_by\_login(params[:login])  
session[:role]=user.organisation  
session[:user\_id]=user.id  
if params[:remember\_me] == “1”  
self.current\_user.remember\_me  
cookies[:auth\_token] = { :value =\>  
self.current\_user.remember\_token , :expires =\>  
self.current\_user.remember\_token\_expires\_at }  
else  
flash[:notice] = “Logged in successfully”  
end  
redirect\_back\_or\_default(:controller =\> ‘/event’, :action =\>  
‘calendar’)  
flash[:notice] = “Logged in successfully”  
end  
end

any ideas? or anyone experienced something similar?

---

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [February 10, 2007, 4:01am UTC](https://www.ruby-forum.com/t/acts-as-authenticated-strangeness/85116/2 "2007-02-10T04:01:54Z")

</div>

mr\_robot wrote:

> hi  
> the strangest thing is happening. on my local machine  
> acts\_as\_authenticated works fine, but whe on the server [dreamhost] it  
> refuses to log in. no error messages. nothing. just reloads the login  
> page again.
> 
> any ideas? or anyone experienced something similar?

Have you migrated/created your user table to the server?

jp

---

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [February 10, 2007, 7:38am UTC](https://www.ruby-forum.com/t/acts-as-authenticated-strangeness/85116/3 "2007-02-10T07:38:43Z")

</div>

yes. if i search for the user in console, not problem. and the  
database on the server is an exact copy of the one on my local machine.

---

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [February 10, 2007, 8:31am UTC](https://www.ruby-forum.com/t/acts-as-authenticated-strangeness/85116/4 "2007-02-10T08:31:45Z")

</div>

the strange thing is really why ut’s goin back to login, and with no  
error/flash message

---

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [February 10, 2007, 3:40pm UTC](https://www.ruby-forum.com/t/acts-as-authenticated-strangeness/85116/5 "2007-02-10T15:40:18Z")

</div>

Perhaps you’re running in production mode [like you should be on the  
server]  
and haven’t restarted the dispatchers, so they’re still running on the  
old  
code.

RSL

---

<div class="post-metadata">

**Author:** ![mr\_robot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@mr\_robot](https://www.ruby-forum.com/u/mr_robot)\
**Post date:** [February 10, 2007, 4:38pm UTC](https://www.ruby-forum.com/t/acts-as-authenticated-strangeness/85116/6 "2007-02-10T16:38:27Z")

</div>

mr\_robot wrote:

> the strange thing is really why ut’s goin back to login, and with no  
> error/flash message

Maybe there’s some funkiness going on with a cookie, have you cleared  
them and/or restarted your browser?

–  
Chris M.  
Web D.

> **[Chriscodes.com is for sale | HugeDomains](https://www.hugedomains.com/domain_profile.cfm?d=chriscodes.com)**
>
> Painless, quick delivery of your domain name. Fast and professional service.
