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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:27:08+00:00 2026-05-12T08:27:08+00:00

Sessions are started via session_start() , I realize that much, but to make sessions

  • 0

Sessions are started via session_start(), I realize that much, but to make sessions persistent, they need an ID.

Now, the php.ini file has a setting:

session.use_cookies = 1

So I don’t have to pass the ID around. But there’s another setting:

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

Am I to understand that if I implement this and go to my website, login, do what I wanna do, shut the browser down and start it again some time later, that I won’t be logged in anymore when I go back to my site?

EDIT: So to stay logged in, I will have to combine this with client-side cookies.

I’m guessing I’ll need 2 database fields. 1 for the sessions ID, 1 for the ID I give to the cookie.

  • 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-12T08:27:08+00:00Added an answer on May 12, 2026 at 8:27 am

    Nope, you won’t be logged in anymore.

    See my answer here: How do I Keep a user logged in for 2 weeks? (See http://www.drupal.org/node/31506 for more information about sheduled tasks, if you want people to be signed out after an amount of time). It might help you.

    Check the user agent string (just for security. If an hacker found out a key in some way… he can send a fake cookie and be logged in automatically. For people who switch a browser one time, they can just sign in again once after copying cookies. However, this would be a disaster for people who change or update browser nonstop).

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

Sidebar

Related Questions

I'm using php Sessions on my website and it seems like they are disappearing
I have recently started using CI and with it CI sessions, but I have
Sessions in PHP seemed to have changed since the last time I used them,
How secure are php Sessions? I am planning to use the native PHP sessions
I've been working with sessions, MVC design and object oriented PHP. Where should I
I have the following code in a PHP file called via Ajax (note -
When I started with Windsor I thought DI would be simple. Now it's causing
This isn't easy to explain, but I'll try my best. The issue has started
I'm making somewhat of a module that gets included into another unrelated PHP application.
I need to start a program from Windows Service. That program is a user

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.