I know that there have been many similar questions on this topic but none of the answer pertain. 

I've decided to follow Michael Hartl's advice and implement my own authentication code instead of using a predefined package. But I'm running into a problem with his solution from the railstutorial. 

I've double/triple checked my code directly with the tutorial code in github, I'm implementing correctly as far as I can see but I have some big problems.

**Current\_user is not being initiated correctly**

helpers/sessions\_helpers.rb

```
    ...
    def current_user=(user)
      @current_user = user
    end

    def current_user
      #this line of code will change in the tutorial section 9 but its okay for now 
      @current_user ||= User.find_by_remember_token(cookies[:remember_token])

    end

    def signed_in?
      !current_user.nil?
    end

```

Any code using the helpers in the views `<% if signed_in? %>` always returns false, even if authentication has worked. And any attempt to access data via user methods like `current_user.first_name.capitalize` fail with `undefined method ``first_name' for nil:NilClass`

Please note this is still section 8 in the tutorial (not at section 9 just yet, I don't really want to add more code to this authentication situation when the basics are not working. Thanks for the help...