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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:48:22+00:00 2026-06-10T04:48:22+00:00

Ive got a PHP Registration/Login system using PHP Sessions which is working perfectly, I

  • 0

Ive got a PHP Registration/Login system using PHP Sessions which is working perfectly, I want the user to be able to tick remember me and then they stay logged in forever or at least a week or something.

Im guessing I need to store a cookie and check, I was confused at what I actually need to store in the cookie. If I store the userid or username then can’t someone just use a fake cookie to look at another users data?

Any advance is 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-06-10T04:48:24+00:00Added an answer on June 10, 2026 at 4:48 am

    Small example that I often use

    function setSession($username,$password,$cookie=null){
        // Other code for login ($_POST[]....)
        // $row is result of your sql query
        $values = array($username,$this->obscure($password),$row['id']);         
        $session = implode(",",$values);
    
        // check if cookie is enable for login
        if($cookie=='on'){
            setcookie("your_cookie_name", $session, time()+60*60*24*100,'/');
        } else {
            $_SESSION["your_session_name"] = $session;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive got a php download script using mod_xsendfile which works perfectly to download certian
hey ive got a working php script, and as far as i can tell
ive got working live search with ajax and php JQUERY: $(#search).keyup(function() { var search_input
Ive got a image cache system that im using to generate certain image sizes
i just got an account at: http://www.whoisxmlapi.com/index.php#/whois-api-doc.php?rid=1 ive never parsed XML with c#, how
I've got a PHP/HTML/Javascript driven front-end for a MySQL database which archives different files/papers
I've got my php working to set a cookie storing the http_referer the visitor
Ive got a problem, Im using jquery for my googlemaps thingy Im doin and
ive got a really weird problem. i have no clue why its not working.
Stupid question. I've got a project that I'm working on in PHP; it's 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.