Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6912241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:04:01+00:00 2026-05-27T09:04:01+00:00

I am learning to create user sign in and sign up. Here is my

  • 0

I am learning to create user sign in and sign up.
Here is my html code for sign in,

<% if signed_in? %>  
  <li><%= link_to "Sign out", signout_path, :method => :delete %></li>  
<% else %>  
  <li><%= link_to "Sign in", signin_path %></li>
<% end %>

But when I am success sign in, the Sign out doesn’t show up.

Someone help me please? 😀

Here is my signed_in? code in SessionHelper

Update 1

module SessionsHelper  
  def sign_in(user)  
    cookies.permanent.signed[:remember_token] = [user.id, user.salt]  
    self.current_user = user  
  end  
  def current_user=(user)  
    @current_user = user  
  end
  def current_user  
    @current_user ||= user_from_remember_token  
  end
  def signed_in?  
    !current_user.nil?  
  end
  def sign_out  
    cookies.delete(:remember_token)  
    self.current_user = nil  
  end  
  def deny_access  
    redirect_to signin_path, :notice => "Please sign in to access this page."  
  end  
  def current_user?(user)  
    user == current_user  
  end  
  def redirect_back_or(default)  
    redirect_to(session[:return_to] || default)  
    clear_return_to  
  end  

private  
  def user_from_remember_token  
    User.authenticate_with_salt(*remember_token)  
  end  
  def remember_token  
    cookies.signed[:remembered_token] || [nil, nil]  
  end  
  def store_location  
    session[:return_to] = request.fullpath  
  end  
  def clear_return_to  
    session[:return_to] = nil  
  end  
end  

Here is my SessionController

Update 2

class SessionsController < ApplicationController  
def new  
  @title = "Sign In"  
end  
def create  
  user = User.authenticate(params[:session][:email], params[:session][:password])  
  if user.nil?  
    flash.now[:error] = "Invalid email/password combination."  
  @title = "Sign in"  
  render 'new'  
else  
  sign_in user  
  redirect_to user  
end  
end  
def destroy  
  sign_out  
  redirect_to root_path  
end  
end  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:04:02+00:00Added an answer on May 27, 2026 at 9:04 am

    In the SessionsHelper, change

    def remember_token
      cookies.signed[:remembered_token] || [nil, nil]
    end
    

    to

    def remember_token
      cookies.signed[:remember_token] || [nil, nil]
    end
    

    Many thanks for your support. 😀

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm still a learning user of SQL-SERVER2005. Here is my table structure CREATE TABLE
I am learning rais from the rails tutorial book: http://ruby.railstutorial.org/chapters/sign-in-sign-out#fnref:9.14 I am working on
I am learning cakephp by myself. I tried to create a user controller with
I am using following tutorial: http://framework.zend.com/manual/en/learning.quickstart.create-model.html When I try to insert record in database
Stuff I've already figured out I'm learning how to create a multi-tenant application in
I am learning to create RESTful services using WCF. There are a myriad of
How does Udacity.com (new learning website) create presentation where the text is in front
I am learning how to create an android app and webservice using: Eclipse IDE
I've been learning how to create WP plugins and I can for the most
Just wondering if anyone has some good resources for learning how to create new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.