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

  • Home
  • SEARCH
  • 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 7649619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:00:50+00:00 2026-05-31T11:00:50+00:00

I have implemented remember me functionality as this question How to create "remember me

  • 0

I have implemented remember me functionality as this question

How to create "remember me checkbox" using Codeigniter session library?

first answer.
I created a cookie with a random number code as value and it stored in db(user table). On login, db code checks with cookie value.It works fine on my localhost server. But in live server which has a subdomain url has problem.Also I tested it with another server with ip address as url. There also it is not working. In both cases cookie created but cant read the cookie. Please help me.

cookie set by

$auto_login_hash_code = uniqid();
$domain = $_SERVER['SERVER_NAME'];
$cookie = array(
            'name' => 'rememberMe',
            'value' => $auto_login_hash_code,
            'expire' => 31536000,
            'domain' => $domain,
            'path' => '/'
);
$this->input->set_cookie($cookie);

and reading cookie by

    if (get_cookie('rememberMe')) {
$hashcode = $this->CI->input->cookie('rememberMe');
$this->CI->load->model('loginmodel', '', true);
$username = $this->CI->loginmodel->get_username_by_hashcode($hashcode);//in this function setting session variables
    }

Thanks in advance
iijb

  • 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-31T11:00:51+00:00Added an answer on May 31, 2026 at 11:00 am

    you are getting library for that on github.
    search remember me on github, load it and just follow below steps.
    Verify cookie if token is present in database go to home page

     $this->load->library('rememberme');  
                $cookie_user = $this->rememberme->verifyCookie();
                if ($cookie_user) 
                {
                    $this->load->view('search_view');
                }
    
    else
            {
                // If checkbox is checked it return true either false
                $checked = (isset($_POST['Checkbox1']))?true:false;  
    
                if($checked== true)
    
                {
                        //$this->load->view('tested');
                        $this->load->library('rememberme');  
                        $this->rememberme->setCookie($this->input->post('loginemil'));
                        //$this->rememberme->setCookie('set cookie here');
    
                }
    else{
    dont set anything
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented remember me option in my asp.net webform by using this, protected
I have implemented remember me functionality in Symfony2. When I log in with remember
I am using a remember me checkbox implemented with a Zend rememberMe function for
I have successfully implemented Remember Me functionality in my application. Only I want to
I have read this question: How do I implement a 'Remember me' function in
I have implemented tracing based on System.Diagnostics. I am also using a System.Diagnostics.TextWriterTraceListener, and
We have implemented a popup window as a modal dialog using the IE method:
I have implemented a linked list as a self-referencing database table: CREATE TABLE LinkedList(
I have implemented a very basic plug-in system as part of a static library
I have implemented spring security's remember me feature in our app, the way i

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.