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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:52:35+00:00 2026-05-23T17:52:35+00:00

I wonder how does the session work in CodeIgniter. Isn’t the session suppose to

  • 0

I wonder how does the session work in CodeIgniter. Isn’t the session suppose to be automatically destried when the browser is closed? The CodeIgniter does not destroy the session on browser close by default:

$config['sess_expire_on_close'] = FALSE;

Instead we can set the session expire time:

$config['sess_expiration']      = 7200;

Now for example if I set the expiration time to 0, it will keep the session as long as I do not destroy by myself:

$this->session->sess_destroy();

So how does the CodeIgniter keeps the session information for specific time, even after the browser is closed?

Also, is it secure if use this default setting(of not expiring the session with browser close) to keep user login for few days? (eg. store in session 'logged_in' => TRUE )

  • 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-23T17:52:36+00:00Added an answer on May 23, 2026 at 5:52 pm

    The session in CodeIgniter do not use the default PHP $_SESSION. It uses its own implementation with cookies. That’s why it’s not destroyed when you close your browser. You can also use session with database in CodeIgniter with the option $config['sess_use_database'] = TRUE; and other things you will find here : http://codeigniter.com/user_guide/libraries/sessions.html

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

Sidebar

Related Questions

I wonder why the following does not work with Visual studio typedef struct {
I wonder how does regex work, my particular regex has an element that looks
I just wonder how does html comment tag work with php code. If I
i wonder what does @ means when we use it before include or require
Any ideas why the following code does not exit the Outlook 2007 process created
I wonder, does there exist something like Velocity , but for internal use? Essentially
Wonder if anyone can help me, the map displays fine but the marker does.
Does anyone know how exactly NTLM authentication works in WCF/basicHttp? I wonder if user
This is probably two questions in one.... Firstly i wonder how does android run
I can not make it clear about how the asp.net's authentication work,I set the

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.