On 14/07/10 19:42, T.L wrote:
> So, I am using request.sessions in one of my views functions but I
> want to add a few more fields to the Session class so it will be
> customized for my project.  

> To sum it up, can anyone tell me some way to customize the Session
> class to my liking?
> 

It seems at least somewhat unlikely to me you _really_ want to do that -
django sessions store key-value pairs already, kinda
what they're there for, and if you go the route of customising
models.Session you'll exclude the use of session backends other than the
db.

http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-sessions-in-views

request.session is just injected by the
django.contrib.sessions.middleware.SessionMiddleware
(probably in default settings.MIDDLEWARE_CLASSES)
If you really, truly want other behaviour you could supply your own
session middleware to put whatever you want on request.session


If your real goal is just improving session security somewhat, you might
want to look at django-paranoid-sessions:
http://github.com/rfk/django-paranoid-sessions/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to