Click here to Skip to main content

Welcome to the Lounge

   

For lazing about and discussing anything in a software developer's life that takes your fancy.
The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct and please don't post ads.

Technical discussions are welcome, but if you need specific help please use the programming forums.


 
GeneralRe: Damn Cookies! PinmemberDalek Dave28-Jun-13 15:51 
GeneralRe: Damn Cookies! PinmemberBillWoodruff28-Jun-13 19:42 
GeneralRe: Damn Cookies! PinprotectorMarc Clifton29-Jun-13 4:11 
GeneralRe: Damn Cookies! PinmemberNeverJustHere29-Jun-13 22:37 
GeneralRe: Damn Cookies! Pinmemberahmed zahmed30-Jun-13 6:49 
GeneralRe: Damn Cookies! PinmemberBCantor1-Jul-13 9:46 
GeneralRe: Damn Cookies! PinmemberBillWoodruff28-Jun-13 19:44 
GeneralRe: Damn Cookies! PinprotectorMarc Clifton29-Jun-13 4:10 
BillWoodruff wrote:
Care to open the kimono a little, and mention, in general terms, how you did this.

 
I've only done this in Ruby on Rails because that's what I've used to write a couple websites, but I'm sure the code:
 
 # create an authentication token if the user has clicked on remember me
    auth_token = SecureRandom.urlsafe_base64
    user.authentication_token = auth_token
    cookies.permanent[:auth_token] = auth_token
 
is very similar to what you can do with ASP.NET. Here, both the cookie key and its data are a random code. Now, there are also many algorithms, from simple hashing to more complex encryption, that you can use for data rather than just storing random authentication codes.
 
From my article: User Authentication in Ruby on Rails[^]
 
Marc

GeneralRe: Damn Cookies! PinmemberTnTinMn29-Jun-13 3:26 
GeneralRe: Damn Cookies! Pinmember_Maxxx_29-Jun-13 3:34 
GeneralRe: Damn Cookies! PinmemberDalek Dave29-Jun-13 3:51 
GeneralRe: Damn Cookies! PinmemberTnTinMn29-Jun-13 4:02 
GeneralRe: Damn Cookies! Pinmemberharold aptroot29-Jun-13 3:41 
GeneralRe: Damn Cookies! PinmemberTnTinMn29-Jun-13 3:59 
GeneralRe: Damn Cookies! Pinmemberharold aptroot29-Jun-13 5:05 
GeneralRe: Damn Cookies! PinmemberCornelius Henning29-Jun-13 5:06 
GeneralRe: Damn Cookies! Pinmemberharold aptroot29-Jun-13 5:09 
GeneralRe: Damn Cookies! PinmemberCornelius Henning29-Jun-13 7:54 
GeneralMy Windows Macbook Air: perf results PinadminChris Maunder28-Jun-13 8:09 
GeneralRe: My Windows Macbook Air: perf results PinprofessionalRichard Deeming28-Jun-13 8:12 
GeneralRe: My Windows Macbook Air: perf results Pinmemberlewax0028-Jun-13 8:17 
GeneralRe: My Windows Macbook Air: perf results PinprofessionalRichard Deeming28-Jun-13 8:21 
GeneralRe: My Windows Macbook Air: perf results PinprofessionalEmmanuel Medina Lopez28-Jun-13 8:42 
GeneralRe: My Windows Macbook Air: perf results Pinmemberthrakazog28-Jun-13 12:18 
GeneralRe: My Windows Macbook Air: perf results PinmemberChris C-B28-Jun-13 8:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 24 Nov 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid