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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:09:31+00:00 2026-05-19T10:09:31+00:00

I know that codeigniter stores it’s sessions as a cookie, which, from reading around

  • 0

I know that codeigniter stores it’s sessions as a cookie, which, from reading around I understand to be somewhat insecure. So… I am planning to enable database storage for sessions, which I believe:

a) Is safer?
b) Allows you to store more data than the 4kb limit offered by cookies?

However on the flipside I guess this will be slower for the system to retrieve, for example, in my application I regularly want to query the session data to determine if a user is logged in.

Is is a good idea to store sessions in the database, or will this slow down my app considerably?

Any other ideas or suggestions regarding sessions and cookies would be most appreciated.

  • 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-19T10:09:32+00:00Added an answer on May 19, 2026 at 10:09 am

    Well, that is true and false. CodeIgniter can be configured to store its data on a DB, but it can encrypt the cookies before storing them on the client. It also MD5’s the cookies contents to ensure data integrity (basically if the Cookie’s MD5 doesn’t match correctly, then it is rejected). So while by default it is possible to edit the cookies, it is more than annoying to do so.

    Personally, I generally prefer to store session level data in the $_SESSION and have modified my session object to allow me to do that. I also make the PHPSESSID variable a good deal more complicated.

    As to your question, “Is it a good idea to store sessions in the database”, well, that depends on how fast your database is and what your memory requirements are. It could slow things down or it could, conceivably, speed things up based on configurations et al.

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

Sidebar

Related Questions

I know that Codeigniter has a very useful security class which can prevent CSRF/XSRF
Anyone know of a tutorial online that explains how to integrate alexbilbie CodeIgniter-OAuth-2.0-Server as
I know that immutable objects always have the same state, the state in which
I know that in order to download a cookie associated with an account using
I know that CodeIgniter already elegantly handles URL's. What I have is a form
Fairly straightforward question: I know that Codeigniter is a MVC framework - however what
I know that codeIgniter turns off GET parameters by default. But by having everything
I'm using Codeigniter and wants to know how I can make a checkbox that
Does someone here know a html parser library that will work with codeigniter?
Hey I'm new to php and codeigniter. I know that in codeigniter's view you

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.