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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:36:31+00:00 2026-06-14T04:36:31+00:00

On a website I am developing I am currently checking if a user is

  • 0

On a website I am developing I am currently checking if a user is logged in if it’s cookies are set. The thing is I’m using these information for some request on the database and allow him to do some tasks on the website. Though, it came to my mind that if the user edit its cookies, he might be able to be someone else (editing it’s username/id). So, is there a way to secure it or do I have to use sessions ?

  • 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-14T04:36:32+00:00Added an answer on June 14, 2026 at 4:36 am

    Yes, you can use cookies. You just need to make sure that the cookie provides data you can use to authenticate the user, and not a token that means the user is authenticated.

    Bad cookie:

    username=foo,logged_in=true
    

    Good cookie:

    token=uifhjrjf4093jf3904j90j390kf934j8438j0493jf9034
    

    And then compare the authentication data against a datastore on the server.

    Do I have to use sessions?

    Sessions are a way to store temporary about a user (who may or may not be authenticated). They are a quick and easy way to solve part of the problem and not something that should cause reactions of Do I have to? 🙁.

    Most session libraries use cookies to store the token that links the collection of data associated with a session to the browser to which the session belongs.

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

Sidebar

Related Questions

I'm currently developing a website which stores bookmarks in a MySQL database using PHP
I'm using django-avatars to handle user profile avatars for my website. I'm currently developing
I'm currently developing a website. Every feature works fine. However, I'm using a lot
I am currently developing a website for an electrical company. They would like some
I'm currently developing a large site that handles user registrations. A social networking website
I'm currently developing a website and part of it involves using Google Maps. I'd
I am currently developing a Website in which user may buy gift cards. I
I'm currently developing a CMS for a website I'm making. I'm using MVCScaffolding to
I'm currently developing a website in HTML and I want to copy some of
I'm currently developing an ASP.NET website, and I'm using ASP.NET's built-in Login control with

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.