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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:59:56+00:00 2026-05-11T09:59:56+00:00

I login in my system and set a cookie this way: setcookie(hello,true,time()+3600); Then I

  • 0

I login in my system and set a cookie this way:

setcookie('hello',true,time()+3600); 

Then I look in the cookie manager of firefox and see that my cookie is set.

When I restart my browser and restart I see in the cookie manager that the cookie is ther but this code:

if(isset($_COOKIE['hello'])){              echo 'yes'; exit;} 

I don’t see anything it redirects me to the login form. Does anyone know what’s going on?

  • 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. 2026-05-11T09:59:57+00:00Added an answer on May 11, 2026 at 9:59 am

    Some things to try:

    1. Explicity set the path attribute of setcookie to / so the cookies are available in the entire domain.
    2. Instead of checking isset, try doing a print_r of $_COOKIE in an otherwise empty PHP file.
    3. The value part of setcookie expects a string, not a boolean. I would imagine as it is right now hello is being set to 1, although this wouldn’t really matter on whether it is surviving a restart or not just thought I’d point it out.
    4. Do you have your browser set to delete cookies on exit? In Firefox, for example, you can go to Tools -> Options -> Privacy and there is an option that says ‘Always clear my private data when I exit Firefox.’ If you have this set any cookies you have will be deleted when you close your browser.
    5. Have you checked access to the cookie from PHP prior to the restart? You say you can see it in Cookie Manager before and after, but can you see it in PHP before or after?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have a question. I have set up my login system with cookies
Hi guys I've set up an openID login system - just like the one
For a login system in php would this be a suitable outline of how
This aspect of my login system works just fine if I have the return
I have this php login system, I had it working great on localhost, I
This is how I'm building a login system: Login: Check username and password supplied
Im trying to set up a Devise Authenticable LDAP login system. Right now, I
I am creating a login system for a web application using PHP. My question
I have a login system, and while logged in, if I refresh the browser,
I am using a login system. When I navigate to comments/index.php without logging in,

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.