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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:58:13+00:00 2026-06-07T03:58:13+00:00

I just read this article and I pretty much got it, although there is

  • 0

I just read this article and I pretty much got it, although there is still something I’m not quite sure about… in the Solution part, the writer talks about a series of tokens.
Did he mean a unique ID for a username that never changes? would the normal user id stored in the database be fine for this use? That ‘normal’ user id will most likely be known to the user, so I’m not sure if this is supposed to be kept secure or not…
And, what is a good way to generate a token ‘from a large space’ as recommended in the article?

  • 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-07T03:58:14+00:00Added an answer on June 7, 2026 at 3:58 am

    One naive way to generate the series of tokens is to iterate a hash:

    T_0: username + hash(username)
    T_1: username + hash(T_0)
    T_2: username + hash(T_1)
    …

    The downside to this approach is a stolen cookie gives away future access. A better way to generate the series of tokens is to use a CTR-style approach:

    R = rand()
    T_0: username + hash(R)
    T_1: username + hash(R+1)
    T_2: username + hash(R+2)
    …

    If the hash is strong enough (SHA-256, for example), and the random number really is selected randomly from a large enough pool (reading a dozen bytes from /dev/urandom for an easy source..) then knowledge of any one cookie couldn’t be used to figure out future cookies — without going through the web service, that is.

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

Sidebar

Related Questions

I just read a fantastic article about WCF transactions and flow. Pretty much only
I just read the Wikipedia page about Bucket sort . In this article they
I already read many article about this issue in here, SO. I just want
I just read this article: The Truth About Garbage Collection In section A.3.3 Invisible
I have just read this interesting article about the implementation details for various languages
i just read this article : https://developer.mozilla.org/en/HTTP_Caching_FAQ There's a firefox behavior (and some other
I just read this article about the Entity Framework 4 (actually version 2). Entity
So I just read this article . What I'm wondering is, is there any
I've just read about @Resource annotation from this article ( http://www.infoq.com/articles/spring-2.5-part-1 ) and wish
I just read this article: http://www.acunetix.com/websitesecurity/upload-forms-threat.htm which discusses some of the security risks involved

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.