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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:28:48+00:00 2026-06-14T16:28:48+00:00

Are cookies and sessions depend on each other in PHP? Does deleting or clearing

  • 0

Are cookies and sessions depend on each other in PHP?

Does deleting or clearing either one of them affect the other?

Does by disabling either one of them in the browser affect the other?

P.S. I am newbie.

Edit: I was newbie at time of writing question. This question is faced by many newbies.

  • 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-14T16:28:50+00:00Added an answer on June 14, 2026 at 4:28 pm

    They are totally independent…

    • Cookies cannot store unlimited value, sessions can
    • You cannot store data in a cookie if user browser cookie is disabled where in session you can, because session id can append to URL
    • It is better to store data in sessions than to store in cookies because cookies can be tempered
    • If you delete cookies, then only those functionalities in your site will be disabled in which you are retrieving these cookies data but you’ll be logged in and if you delete session cookie, you’ll be logged out.. (1)
    • Cookies are stored on client machine where session are stored on your server
    • A session is ended if you close you browser while cookies stay there unless they are manually removed by the user or till they are expired

    Inshort you’ve better control over sessions than on cookies

    (1) For example if you are setting a cookie name demo and you are using a splash screen unless and until the demo is set you’ll show a splash screen

    if(!isset($_COOKIE['demo'])) { //Now this will show lightbox always if user has disabled his cookies
       <script>...</script>
    }
    

    Articles

    http://www.klovera.com/php-sessions-vs-cookies/

    Reference

    Session

    Cookies

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

Sidebar

Related Questions

Regarding PHP security with cookies and sessions, this is what i have done so
How can I create cookies or sessions in android platform? I am using one
I'm pretty new to PHP and am experimenting with cookies and sessions. So, in
I'm new to PHP, I've read a lot of tutorials about cookies and sessions
middleware depend on each other, for example methodOverride() checks req.body.method for the HTTP method
Is there a way except cookies/sessions(user can clear them) which allow HTTP server to
Anyone know how I can use httponly cookies for sessions and cookies on the
I have been considering the problems arising with user authentication, using sessions/cookies and the
For sessions and cookies, is there a difference between example.com and www.example.com? I have
Do i login using cookies or sessions in a login system? I've seen examples

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.