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 106783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:39:04+00:00 2026-05-11T01:39:04+00:00

How do you implement this in CodeIgniter?

  • 0

How do you implement this in CodeIgniter?

  • 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. 2026-05-11T01:39:04+00:00Added an answer on May 11, 2026 at 1:39 am

    (This answer was a response to the original question)

    How would you do this ? Or, how would you create a session with a longer expiration date than the others ?

    All created sessions would use the same $config[‘sess_expiration’] in the config file (default: 7200 seconds), is there a way to pass a custom value ?

    Extending the expiration of a session cookie isn’t going to work for a ‘remember me’ feature, since the user will lose their session cookie when they close the browser. If Code Igniter doesn’t have a native ‘remember feature’, then you’ll need to write something to drop a long-life cookie which contains information which will allow an automatic login when the server sees it again.

    There’s a good article on Persistent Login Cookie Best Practice, which can be summarized as:

    1. When the user successfully logs in with Remember Me checked, a login cookie is issued in addition to the standard session management cookie.2
    2. The login cookie contains the user’s username and a random number (the ‘token’ from here on) from a suitably large space. The username and token are stored as a pair in a database table.
    3. When a non-logged-in user visits the site and presents a login cookie, the username and token are looked up in the database. 1. If the pair is present, the user is considered authenticated. The used token is removed from the database. A new token is generated, stored in database with the username, and issued to the user via a new login cookie. 2. If the pair is not present, the login cookie is ignored.
    4. Users that are only authenticated via this mechanism are not permitted to access certain protected information or functions such as changing a password, viewing personally identifying information, or spending money. To perform those operations, the user must first successfully submit a normal username/password login form.
    5. Since this approach allows the user to have multiple remembered logins from different browsers or computers, a mechanism is provided for the user to erase all remembered logins in a single operation.

    Another article which builds more security onto those ideas in Improved Persistent Login Cookie Best Practice

    If you follow the practices in those articles, you won’t go far wrong!

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

Sidebar

Ask A Question

Stats

  • Questions 117k
  • Answers 117k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Wrap it with form tag, set it's method to "GET",… May 11, 2026 at 10:46 pm
  • Editorial Team
    Editorial Team added an answer This could be similar to SO question "git svn rebase:… May 11, 2026 at 10:45 pm
  • Editorial Team
    Editorial Team added an answer For consistency with the way you're doing it you want:… May 11, 2026 at 10:45 pm

Related Questions

Informally, most of us understand that there are 'binary' files (object files, images, movies,
I've read at various websites that Thread.Abort is not very good to use. In
How do you implement an efficient and thread safe reference counting system on X86
How Do You Implement Specification Pattern for querying database using NHibernate?(without LINQ to NHibernate).I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.