--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
You can just store a dict of UUID-to-primary key values in the session data.
We needed a similar way to obfuscate publicly accessible objects and we didn't want usage information leaked by exposing the public key. We found and have been using short_url for over six months now. We use <http://www.michaelfogleman.com/2009/09/python-short-url-generator/> to generate short URL's from the primary key (integer). The short_url code is handy, because it doesn't need any extra columns in the database and it is pretty hard for users to reverse engineer the primary key id from the short URL.
--
Eric Chamberlain, Founder
RF.com - http://RF.com/
I thought they were called cookies?
> Basically you keep all data on the
> server, and only give the client an identifier of that data.
Yeah, sounds exactly like a session-based cookie.
--
Greg Donald
destiney.com | gregdonald.com
Although, the URLs are going to look ugly as sin, and I wouldn't
recommend this if you want decent SEO lol.
Remember you'd have to cater for encrypting redirects, query string
separation etc, and you've have to overwrite the request META vars so
that the app logic doesn't need to be patched.
Cal
I.e. if you are allowing the user to access an object in the database,
and not enforcing any restrictions other than client side UI, then this
is bad.
This topic spreads wayyyyyyyy long cookies and sessions lol.
On May 10, 2011, at 4:02 PM, "Cal Leeming [Simplicity Media Ltd]"<cal.l...@simplicitymedialtd.co.uk> wrote:
> Sean, are you suggesting that the OP rely on base36 encoding for security? Please tell me you are joking.
No not at all, I thought he stated this does not have to be secure.
If it does, then yeah my code is a bad idea. If security is a issue this should be behind a password.
Why cant you do something like this to avoid exposing data if people are guessing primary keys....
if request.user == Users.objects.get(id=pk-url):
Show data
Else:
raise 404 or redirect to home page
The above requires a logged in a user but you get the idea of not allowing people to start guessing to expose data.
Wes
Why cant you do something like this to avoid exposing data if people are guessing primary keys....
if request.user == Users.objects.get(id=pk-url):
Show data
Else:
raise 404 or redirect to home pageThe above requires a logged in a user but you get the idea of not allowing people to start guessing to expose data.