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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:33:51+00:00 2026-05-28T03:33:51+00:00

Correct me if I’m wrong please: Sessions will last a finite amount of time

  • 0

Correct me if I’m wrong please:

  • Sessions will last a finite amount of time (refreshed from the server every 15 or so minutes until the browser is closed) – more secure/short term
  • Cookies on the other hand can last until the browser closes or to some specific time in the future – least secure/long term

Given this, how do allow a user to close his/her computer, come back a few days later and open a site and still be logged in using cookies and still somehow being secure?

How does someone like, amazon for instance do this?

EDIT:

To be more clear, here is an example:

if (!isset($_SESSION['id'])) 
{   
    $_SESSION['id'] = $_COOKIE['id'];
    $_SESSION['email'] = $_COOKIE['email'];
}

this is obviously bad, what is a better way?

  • 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-28T03:33:52+00:00Added an answer on May 28, 2026 at 3:33 am

    For the cookies I use the method described here:
    http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice/
    and here: http://jaspan.com/improved_persistent_login_cookie_best_practice

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

Sidebar

Related Questions

Please correct me if I am wrong. Thank you! insert and erase will relocate
Please correct me if I am wrong, but is one complex query less expensive
Correct me if I'm wrong, but Server studio doesn't have relationship connectors. Is there
Please correct me if I am wrong. I am asking this question to clarify
Please correct me if I am wrong. When running java [-options] -jar jarfile with
Please correct me if I am wrong but I understand that John McCarthy was
Please correct me if I am wrong or barking up the wrong tree. There
Please correct me if am wrong ... Scala introduces new paradigms like TypeTheory, Continuations,
Please correct me if i am wrong. There are two types of IP -
(Correct me if I'm wrong.) A server host can detect the pages that a

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.