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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:15:12+00:00 2026-06-01T14:15:12+00:00

I have a website that uses OpenID to sign in users. The library I’m

  • 0

I have a website that uses OpenID to sign in users. The library I’m using, returnes a user profile when the user logges in. This profile contains user’s email, name, a link to the avatar and an ID which the OpenID provider has returned.

My strategy for keeping the user logged in is this:

  • When the user logges in for the first time, I create a hash code based on the OpenID’s returned ID
  • I store this hash code alongside the user’s ID in 2 cookies.
  • When the user comes to my website, I check for these cookies, and if they’re available, try to match the ID and the hash code, if it’s correct, I log the user in.

Now the problem is this: if somehow this cookie information gets stolen from the user, the hacker can easily log in instead of the user himself. I could create a new hash code for each time the user logges in and update the user’s cookeis but it’ll make the information of other browsers/computers cookies invalid.

Since the StackOverflow website does not suffer from such problem, I would like to know what should I do to both secure my login strategy and add the functionality to stay signed in for the users.

  • 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-01T14:15:13+00:00Added an answer on June 1, 2026 at 2:15 pm

    The standard way to do this is to assign a meaningless session ID and send that as a cookie; in your database, you can store the user’s credential information alongside that session ID. When a user logs out, you can invalidate that session ID.

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

Sidebar

Related Questions

So I have this ASP.Net 2.0 website that uses functions contained within a JS
i have a website that uses screen.css as main CSS file. I added this
Hi, I have built a ASP.NET MVC website that uses Membership, this works fine.
I have a website that uses a db to store information for site users.
I have website that uses ASP.net Membership Provider. This web site will be served
i have a website that uses a number of containers (div's). In this scenario,
I have a website that uses JSP as its view technology (and Spring MVC
I have a website that uses basic ASP.Net forms authentication. In the web.config file
I have a website that uses the facebook, twitter, delicious share links. They contain
I have a website that uses flash. I would like to convert the website

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.