Tell me more ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I am trying to find a reliable source for cookie management. I read though OWASP so i roughly know what can be dangerous.

But I need to authenticate my users with cookies. Is there a complete step by step guide?

What I did:

  • generate a random and unique string.

  • associate the random string with a user in my cache rndstring -> user

  • create a secure and signed cookie. value= hash(rndstring+secret)|rndstring

  • if the user comes back, I check if the hashes matches, and if the rndstring is in my cache.

  • if yes get the user.

I think my approach is flawed because I made it by myself. What resources can you recommend me?

share|improve this question
1  
Welcome to Web Apps Maik! This site is for questions relating to using web applications rather than building them. For IT security questions, try the IT Security site. If you have a specific programming question, Stack Overflow is the place to be. Cheers! – John C Aug 7 '12 at 0:19
ups, okay thank you, – Maik Klein Aug 7 '12 at 7:30

closed as off topic by Alex, Barry Aug 7 '12 at 8:09

Questions on Web Applications Stack Exchange are expected to relate to web applications within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.