FYI: Django Supports Sessions By Default

2023-05-18 Thread Chetan Ganji
http://cryto.net/~joepie91/blog/2016/06/13/stop-using-jwt-for-sessions/ Regards, Chetan Ganji +91-900-483-4183 ganji.che...@gmail.com http://ryucoder.in -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

Re: django multi databases and multi sessions

2023-03-21 Thread Ujjwal Joshi
-tenancy online. On Mon, 20 Mar 2023 at 20:53, WM wrote: > Hi, > > I would like to have your help. > > Using Django multiple databases in a project, can I create multiple > sessions in the project? If so, I would like to know how to. For example, > three databases wit

Re: django multi databases and multi sessions

2023-03-20 Thread Dan Wood
I’m working on a big multi tenant app feel free to email for information, I use a different schema for each tenant -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email t

Re: django multi databases and multi sessions

2023-03-20 Thread Sebastian Jung
I think you mean multi tenancy... There are packages for that. Google after django multi tenant.. WM schrieb am Mo., 20. März 2023, 16:08: > Hi, > > I would like to have your help. > > Using Django multiple databases in a project, can I create multiple > sessions in the proje

django multi databases and multi sessions

2023-03-20 Thread WM
Hi, I would like to have your help. Using Django multiple databases in a project, can I create multiple sessions in the project? If so, I would like to know how to. For example, three databases with two different login functions; The steps are followed: In a webpage, login as a homepage

I teach Django for beginners for free ( Live sessions )

2021-07-02 Thread Symaxx
I teach Django the Python framework for free. Those interested join my Whatsapp group for free live sessions https://chat.whatsapp.com/DpOEaJTyhcXGF4YnFe3XLm <https://chat.whatsapp.com/DpOEaJTyhcXGF4YnFe3XLm?fbclid=IwAR0MvJXoUe4QCz9vHsPVIQRDixvXo4ikxbpsu2HfZfX0BQduHrwUiwIu

Re: Log out all sessions for current user logged in

2021-03-01 Thread Ryan Nowakowski
You might need to call get_decoded then flush on that. https://docs.djangoproject.com/en/3.1/topics/http/sessions/ On February 28, 2021 11:48:51 PM CST, Salima Begum wrote: >New code for logging out all sessions of logged in users. > >``` > ># Logout all devices in account secu

Re: Log out all sessions for current user logged in

2021-02-28 Thread Salima Begum
New code for logging out all sessions of logged in users. ``` # Logout all devices in account security page. def logoff_all(request): try: # Filtering all session objects. session_query = Session.objects.all() # Iterating session_query and fetching session key

Re: Log out all sessions for current user logged in

2021-02-27 Thread Ryan Nowakowski
;On Sat, 27 Feb 2021, 12:35 am Ryan Nowakowski, >wrote: > >> Have your tried my suggestion below? Did it work? >> >> On February 25, 2021 9:42:55 PM CST, Salima Begum < >> salim...@rohteksolutions.com> wrote: >>> >>> Logout all sessions

Re: Log out all sessions for current user logged in

2021-02-26 Thread Salima Begum
, Salima Begum < > salim...@rohteksolutions.com> wrote: >> >> Logout all sessions belong to logged in user Can you please how can I >> achieve this? >> >> Thanks >> ~salima >> >> On Fri, Feb 26, 2021 at 4:56 AM Ryan Nowakowski >> wrote: >> >>

Re: Log out all sessions for current user logged in

2021-02-26 Thread Ryan Nowakowski
Have your tried my suggestion below? Did it work? On February 25, 2021 9:42:55 PM CST, Salima Begum wrote: >Logout all sessions belong to logged in user Can you please how can I >achieve this? > >Thanks >~salima > >On Fri, Feb 26, 2021 at 4:56 AM Ryan Nowakowski >wr

Re: Log out all sessions for current user logged in

2021-02-25 Thread Salima Begum
Logout all sessions belong to logged in user Can you please how can I achieve this? Thanks ~salima On Fri, Feb 26, 2021 at 4:56 AM Ryan Nowakowski wrote: > On Wed, Feb 17, 2021 at 08:23:08AM +0530, Salima Begum wrote: > > Logout all sessions based on current user id and clear django

Re: Log out all sessions for current user logged in

2021-02-25 Thread Ryan Nowakowski
On Wed, Feb 17, 2021 at 08:23:08AM +0530, Salima Begum wrote: > Logout all sessions based on current user id and clear django sessions > table based on user id. It is logging off all sessions. > > ``` > # Logout all devices in account security page. > def logoff_all(r

Cannot modify existing sessions using signed_cookies backend

2020-07-03 Thread Krishna Chaitanya
Hi Guys, I am using sessions in my webapp, and don't want to use a db/file backends as my device has small storage, so, using signed_cookies backend, I need to store and modify per-session data across places and use the session_key to lookup, modify and then save. But every save crea

Re: django sessions

2019-07-07 Thread Chetan Ganji
Hii, below answer might ring some bells. https://stackoverflow.com/questions/2551933/django-accessing-session-variables-from-within-a-template Cheers! On Sat, Jul 6, 2019, 5:24 PM Luka Lelashvili wrote: > Hello, how can I access session in my base.html? {% request.session.name > %} doesn't wo

django sessions

2019-07-06 Thread Luka Lelashvili
Hello, how can I access session in my base.html? {% request.session.name %} doesn't work on base.html any clues? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Django active sessions

2019-03-22 Thread Alejandro Martin Herve
I would like to know if there is a way to detect if a session is no longer active. I have a Django web app that when a user logs in, his session is set to expire at browser close request.session.set_expiry(0) this will close the session at browser close efectively but his expire time gets a de

Django active sessions

2019-03-22 Thread Alejandro Martin Herve
Hi, I would like to know if there is a way to detect if a session in no longer active, I'll explain better. I have a setup in my web app where when a user logs in automatically his session is set to expire at browser close: request.session.set_expiry(0) But despite this work effectively, the s

Re: Using sessions key variables as a url argument

2019-03-14 Thread Perchouli
Hi Gavin, You passed pk from URL. class TeamInfo(APIView): #... def get(self, request, pk): # Add pk to params club_pk = self.kwargs.get('pk') # get the pk #... return Response({ 'club_pk': club_pk }) Will pass the

Re: Using sessions key variables as a url argument

2019-03-13 Thread GavinB841
Hi Alvaro/Ranganath, Appreciate your feedback, I understand what you are recommending but I can seem to get it working. Please see the below hopefully it will make more sense: *View sample for team:* class TeamInfo(APIView): renderer_classes = [TemplateHTMLRenderer] template_name = 't

Re: Using sessions key variables as a url argument

2019-03-11 Thread Ranganath Kulkarni
You can define urlpatterns as below: url(r'^club_home/$/teams/', include('clubkit.clubs.urls'), name='clubs'), So that $ will match for any single value primary key. On Sunday, March 10, 2019 at 2:57:43 PM UTC, GavinB841 wrote: > > Hi all, > > I am not sure if this is possible as I could find

Re: Using sessions key variables as a url argument

2019-03-11 Thread Perchouli
Not sure I understand about the "pass that session key variable into the URL argument". But if you want the URL (http://127.0.0.1:8000/club_home//teams/) works, change this path: urlpatterns = [ path('/teams/', views.club_home, name='club_home'), ] On Sun, Mar 10, 2019 at 10:57 PM Gavin Boy

Using sessions key variables as a url argument

2019-03-10 Thread Gavin Boyle
Hi all, I am not sure if this is possible as I could find nothing online but would appreciate any alternative solution. - In my view I obtain a pk which is set as a session key - I need to pass that session key variable into the url argument. e.g. http://127.0.0.1:8000/club_home//teams/ C

Django sessions not configuration issues for Heroku/Redis

2018-10-10 Thread jesse
Hello, I'm having issues with Django sessions on Heroku/Redis. I expect to be able to login and stay logged in. Instead, user will continually be logged out and sessions do not persist. I posted more details on Stack Overflow here: https://stackoverflow.com/questions/52535488/django-ses

Django sessions configuration issues in production with Heroku/Redis

2018-10-10 Thread jesse
Hello, I'm having trouble configuring Django sessions to be persistent. I expect a user to be able to log in on first try and then stay logged in. Currently, it takes multiple tries to login and then the user is logged out. Sessions are clearly not persisting. I posted a bounty for th

Re: How to delete least recently used not expired django sessions?

2018-08-22 Thread Web Architect
. The challenge is to figured out the sessions for logged in users (atleast I am not aware of how to do that in Django). Typically in businesses, users (specifically the masses and who aren't that tech savvy) prefer a flow that's smooth and hassle free though security definitely

Re: How to delete least recently used not expired django sessions?

2018-08-22 Thread Web Architect
for your response. >> >> As mentioned in my earlier post...I have a long expiry date for the >> sessions (and hence, the cookies) as we want our users to be always logged >> in or in session (till they clear their cookies). And that's what is >> causing the iss

Re: How to delete least recently used not expired django sessions?

2018-08-20 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Fri, Aug 17, 2018 at 05:44:22AM -0700, Web Architect wrote: > Hi, > > We are using persistent django sessions for our website where in the > session information is stored in MySQL. Over last couple of years, the > session data

Re: How to delete least recently used not expired django sessions?

2018-08-20 Thread Avraham Serour
AM Web Architect wrote: > Hi Jason, > > Thanks for your response. > > As mentioned in my earlier post...I have a long expiry date for the > sessions (and hence, the cookies) as we want our users to be always logged > in or in session (till they clear their cookies). And tha

Re: How to delete least recently used not expired django sessions?

2018-08-19 Thread Web Architect
Hi Jason, Thanks for your response. As mentioned in my earlier post...I have a long expiry date for the sessions (and hence, the cookies) as we want our users to be always logged in or in session (till they clear their cookies). And that's what is causing the issue. The goal is to kee

Re: How to delete least recently used not expired django sessions?

2018-08-19 Thread Web Architect
Hi Hemendra, Thanks for the workaround. Would look at it's feasibility in our existing scenario. Thanks. On Saturday, August 18, 2018 at 3:58:10 PM UTC+5:30, HEMENDRA SINGH HADA wrote: > > Hi, > > I can suggest one thing it might be useful for you. For this you need to > create one more att

Re: How to delete least recently used not expired django sessions?

2018-08-18 Thread Mike Dewhirst
that doing so once would permit a clearing of the entire slate as you seemed to be thinking and only real users would create new sessions. That might be appropriate after you implement one or other of the technical suggestions. There is more to consider too. If it is an ecommerce site securi

Re: How to delete least recently used not expired django sessions?

2018-08-18 Thread Jason
With database sessions out of the box, no. https://github.com/django/django/blob/master/django/contrib/sessions/base_session.py You can see there are three attributes for a session model: key, data and expire_date That said, since sessions are backed by browser cookies, django's defaul

Re: How to delete least recently used not expired django sessions?

2018-08-18 Thread HEMENDRA SINGH HADA
Hi, I can suggest one thing it might be useful for you. For this you need to create one more attribute in session table like *last activity,* which will update every time when user is logged in and perform some action. Write one middle-ware which will check the activity of each user and update

Re: How to delete least recently used not expired django sessions?

2018-08-18 Thread Web Architect
Hi Mike, Thanks for your response. Ours is an ecommerce site and forcing logouts especially for our regular users, might not be desirable from business point of view . Hence, ideally we would like to keep sessions where users's last activity should be within a given time period l

Re: How to delete least recently used not expired django sessions?

2018-08-17 Thread Mike Dewhirst
On 17/08/2018 10:44 PM, Web Architect wrote: Hi, We are using persistent django sessions for our website where in the session information is stored in MySQL. Over last couple of years, the session data has grown to a huge number and we were planning to clean it up. I know that there is a

How to delete least recently used not expired django sessions?

2018-08-17 Thread Web Architect
Hi, We are using persistent django sessions for our website where in the session information is stored in MySQL. Over last couple of years, the session data has grown to a huge number and we were planning to clean it up. I know that there is a django management command 'clearsessions&#x

Re: sessions

2018-06-25 Thread 赖信桃
You can read the docs: https://docs.djangoproject.com/zh-hans/2.0/topics/http/sessions/#django.contrib.sessions.backends.base.SessionBase or the source code: https://github.com/django/django/blob/578e576c31fcd5757c3f4fc2dea7673b3462f575/django/contrib/sessions/backends/base.py If still confusing

sessions

2018-06-23 Thread john speny
What does the method session.keys() do or particularly that keys() method -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.c

Using Django Sessions

2018-03-23 Thread Derek Zeng
You can have a flag in cart class to mark if things are cleared. Then in the __iter__ function, check the flag before getting the keys. If you do this you also need to add the check in add/remove and others accordingly. -- You received this message because you are subscribed to the Google Grou

Using Django Sessions

2018-03-22 Thread Manu Febie
Hello, I am practicing for my college exams. I am building a Restaurant Order System with Django and I am using Django sessions for the first. I borrowed some ideas from the "Django by example". Below you can find the MenuItem model and Order Model. class MenuItem(models.Model):

Re: sharing sessions

2018-03-19 Thread Andy
t; AFAIK Django uses the settings.SECRET_KEY for jobs like this. I set the > same key in both applications, but as soon as Django tries to validated the > sessions data with its hash, it will compute a wrong hash and discard the > data. > > So whats needed for 2 Django apps to actua

sharing sessions

2018-03-19 Thread Andy
. AFAIK Django uses the settings.SECRET_KEY for jobs like this. I set the same key in both applications, but as soon as Django tries to validated the sessions data with its hash, it will compute a wrong hash and discard the data. So whats needed for 2 Django apps to actually be able to have the

Django memcached sessions engine over SSL

2018-01-31 Thread massimo
Hi guys, It is possible to use the django.core.cache.backends.memcached.MemcachedCache backend for caching and use it over SSL/TLS ? I'm using Openstack Horizon, and i want to encrypt the connection between the horizon server and the memcached host. Thanks !! -- You received this messag

Re: Using sessions in Django

2016-09-24 Thread Andreas
Thanks for the help, although i get an error, saying "DataError: value too long for type character varying(2000)" when i am trying to save the "Session.objects.get(session_ key=request.session.session_key)". I checked my db and the "session_id" column is varchar(40) (which is the default value

Keeping sessions

2015-05-20 Thread Ajay M
Hi, I've created my own user model for my project and it is like this from django.db import models from webapp.models.groupimport Group from webapp.models.userrole import UserRole class GroupAdmin(models.Model): user_name = models.CharField(max_length = 200, blank=T

Re: Performance of file-based sessions vs database-backed sessions

2015-03-27 Thread Filipe Ximenes
>From what I understand, using file based sessions will work with no problems in production environment. But, you will have a problem in case you need to horizontally scale (have multiple machines serving your app) your system. In this situation, since files from one machine wont be able to acc

Performance of file-based sessions vs database-backed sessions

2015-03-27 Thread David Riddle
I am using Django 1.7, and I have read the documentation on the SESSION_ENGINE setting. It is not clear to me what are the advantages and disadvantages of using file-based sessions. Do file-based sessions have better or worse performance than database-backed sessions? Are file-based sessions

Re: django + OAuth2: Sessions

2015-01-01 Thread Collin Anderson
Hi, You could try asking on the python-social-auth email list if you haven't. https://groups.google.com/forum/?fromgroups#!forum/python-social-auth Collin On Tuesday, December 30, 2014 7:53:16 AM UTC-5, t.bakogiannis wrote: > > Hi everyone, > > I am using python-social-auth to implement login v

django + OAuth2: Sessions

2014-12-30 Thread Anastasios Bakogiannis
Hi everyone, I am using python-social-auth to implement login via Google, Github, ... The problem I am having is that after the user is redirected to Google or Github the sessionid is reset. I want to preserve the sessionid in order to associate it later with the username. I did some research but

Django, Flask, and Redis: Sharing User Sessions Between Frameworks

2014-03-21 Thread H Singer
(like Flask) by sharing user sessions with Redis: http://www.toptal.com/django/django-flask-and-redis-sharing-user-sessions-between-frameworks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiv

Re: Javascript and sessions

2014-02-27 Thread Camilo Torres
On Wednesday, February 26, 2014 10:41:38 PM UTC-4:30, Luke Baker wrote: > > My web application is heavily based around form input. I'd like to update > the user's session with each form input that they update or change while > working with a form. I'm thinking of implementing some simple javascri

Re: Javascript and sessions

2014-02-27 Thread C. Kirby
It sounds like you are trying to implement a wizard. If you are, Django has one built in: https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/ On Wednesday, February 26, 2014 9:11:38 PM UTC-6, Luke Baker wrote: > > Hey there, > > (Forgive my ignorance) > > My web application

Javascript and sessions

2014-02-26 Thread Luke Baker
Hey there, (Forgive my ignorance) My web application is heavily based around form input. I'd like to update the user's session with each form input that they update or change while working with a form. I'm thinking of implementing some simple javascript that listens for 'change' events on each

Re: Invalidating active sessions after a password change?

2014-01-29 Thread Альберт Тугушев
jango based application. > > When a users changes its password, its active sessions are not destroyed. > I mean, if a user is logged in two different places (or in two different > browsers) and changes its password on one place, the other session will > still > be active. >

Problem with django-dynamodb2-sessions

2013-12-27 Thread Andreas Kuhne
Hi all, We have just migrated our website to Amazon AWS. It works perfectly except for one thing. We are using the django-dynamodb2-sessions plugin to manage our sessions. For most of the time it works ok, but then we get errors with the following error in them: ConditionalCheckFailedException

Django and sessions race condition

2013-12-11 Thread Martin F
I have lost one day with struggling with django sessions and it seems that I am not really able to resolve it without coding my own sessions middleware or using some locking. The problem is, sessions are not stored even if the saving is triggered manually. It happens now and then, because of

Handle django sessions when doing file-operations

2013-12-04 Thread sachin
p" within the root of the project directory. I need to handle this using django-sessions. I need some pointer/examples so that I can solve this issue. More about this app: https://github.com/psachin/haqiba -- You received this message because you are subscribed to the Google Groups "Djang

Re: Problem with clearsession admin command and file based sessions

2013-11-28 Thread Douglas Fraser
orever and 'clearsessions' won't clean them up, if set_expiry is not being explicitly called. This is sort of like all the questions I've seen about database sessions and 2.4GB of them and ... There is something wrong here, but for me to spend any more time figuring it out versus j

Re: Problem with clearsession admin command and file based sessions

2013-11-28 Thread Tom Evans
On Thu, Nov 28, 2013 at 5:10 PM, Douglas Fraser wrote: > > > On Thursday, November 28, 2013 4:49:37 PM UTC, Douglas Fraser wrote: >> >> Hi, >> >> The website I deal with uses file based sessions, and there is no >> logging in of users or anything like

Re: Problem with clearsession admin command and file based sessions

2013-11-28 Thread Douglas Fraser
On Thursday, November 28, 2013 4:49:37 PM UTC, Douglas Fraser wrote: > > Hi, > > The website I deal with uses file based sessions, and there is no > logging in of users or anything like that. Most of the time, no data is > put into the session, and the session expiry time

Problem with clearsession admin command and file based sessions

2013-11-28 Thread Douglas Fraser
Hi, The website I deal with uses file based sessions, and there is no logging in of users or anything like that. Most of the time, no data is put into the session, and the session expiry time is not explicitly set in the code. I've set SESSION_COOKIE_AGE to 48 hours, and so I'd

Re: Sessions memory issue

2013-10-25 Thread François Schiettecatte
can identify your users with request.user if they have to have an > account, or request.session.session_key if they don't, the session_key is the > cookie. For either to work the client has to accept cookies. > > The temporary file approach will required a database table to link the

Re: Sessions memory issue

2013-10-25 Thread John Carlo
temporary file approach will required a database table to link the > file name to the user. > > I have used all of these and they all work well. > > If you need the text to be persistent across sessions I would store it in > a database, if it is around for an hour then just

Re: Sessions memory issue

2013-10-24 Thread François Schiettecatte
ey is the cookie. For either to work the client has to accept cookies. The temporary file approach will required a database table to link the file name to the user. I have used all of these and they all work well. If you need the text to be persistent across sessions I would store it in a dat

Sessions memory issue

2013-10-24 Thread John Carlo
trings. Then, a function combines the lists generated from the istances and send them to the client. I store the istances in the session, and the combining function get the istances through session. The problem is that the lists of strings comsume a lot of memory... I know that sessions are sto

How to store an object in django sessions framework

2013-08-16 Thread shiva krishna
python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/home/user/virtualenvironment/apps/app/payment/views.py", line 120, in PaymentSuccess print request.se

Re: Avoiding Sessions

2013-03-27 Thread Tom Evans
On Wed, Mar 27, 2013 at 1:35 PM, Venkatraman S wrote: > So, if i am right, usage of sessions makes an extra call to the DB for every > view with login_required. > > SELECT "auth_user"."id", "auth_user"."password", "auth_user".&qu

Re: Avoiding Sessions

2013-03-27 Thread Shawn Milochik
asons, not the least of which is performance. Also, built-in key expiration in Redis is excellent (check your existing session table for the entire history of sessions for your application). -- You received this message because you are subscribed to the Google Groups "Django users" g

Re: Avoiding Sessions

2013-03-27 Thread Venkatraman S
7, 2013 at 7:28 PM, Shawn Milochik wrote: > Use django-redis-sessions as a back end instead of the database. > On Mar 27, 2013 9:35 AM, "Venkatraman S" wrote: > >> So, if i am right, usage of sessions makes an extra call to the DB for >> every view with log

Re: Avoiding Sessions

2013-03-27 Thread Shawn Milochik
Use django-redis-sessions as a back end instead of the database. On Mar 27, 2013 9:35 AM, "Venkatraman S" wrote: > So, if i am right, usage of sessions makes an extra call to the DB for > every view with login_required. > > SELECT "auth_user"."id", "

Avoiding Sessions

2013-03-27 Thread Venkatraman S
So, if i am right, usage of sessions makes an extra call to the DB for every view with login_required. SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "

Re: Invalidating active sessions after a password change?

2012-10-03 Thread Dirley
- It calculates the token based on the user's current password. When the user changes it's password, all it's active sessions are automatically invalidated. Even the current one (the one where the password change was done). I've managed to avoid this problem by calling

Re: Invalidating active sessions after a password change?

2012-10-03 Thread Cal Leeming [Simplicity Media Ltd]
Yeah, this debate is borderline silly now. OP, in a nut shell; 1) It is completely acceptable to revoke all other sessions after a password change 2) There are many ways to revoke sessions, pick one that is right for your use case. 3) Whether session revoking is enforced or optional is a choice

Re: Invalidating active sessions after a password change?

2012-10-03 Thread Tom Evans
t;> >> Other large commercial systems, for >> instance google apps, do not behave in this manner, so I'm not sure >> where the expectation comes from - can anyone name a public facing >> system that invalidates all other sessions on password change? > > > Let&#

Re: Invalidating active sessions after a password change?

2012-10-02 Thread Cal Leeming [Simplicity Media Ltd]
expectation comes from - can anyone name a public facing > > system that invalidates all other sessions on password change? > > > > I'd be more likely to expect any such system to, instead, limit an > account/user to /one/ active session... So the mere act of l

Re: Invalidating active sessions after a password change?

2012-10-02 Thread Cal Leeming [Simplicity Media Ltd]
t; >> > I've recently discovered this issue with my django based application. > >> > > >> > When a users changes its password, its active sessions are not > >> > destroyed. > >> > I mean, if a user is logged in two different places (or in

Re: Invalidating active sessions after a password change?

2012-10-02 Thread Tom Evans
>> > >> > When a users changes its password, its active sessions are not >> > destroyed. >> > I mean, if a user is logged in two different places (or in two different >> > browsers) and changes its password on one place, the other session will >> &g

Re: Invalidating active sessions after a password change?

2012-10-02 Thread Cal Leeming [Simplicity Media Ltd]
Sorry, my previous reply looked like I was disagreeing with the OP, this is not the case. I was disagreeing with this comment; Sessions aren't tied to specific users, and so cannot easily be invalidated like that. Personally, I wouldn't have the expectation that changing my pass

Re: Invalidating active sessions after a password change?

2012-10-02 Thread Cal Leeming [Simplicity Media Ltd]
On Tue, Oct 2, 2012 at 3:51 PM, Tom Evans wrote: > On Tue, Oct 2, 2012 at 3:22 PM, Dirley wrote: > > I've recently discovered this issue with my django based application. > > > > When a users changes its password, its active sessions are not destroyed. > > I

Re: Invalidating active sessions after a password change?

2012-10-02 Thread Tom Evans
On Tue, Oct 2, 2012 at 3:22 PM, Dirley wrote: > I've recently discovered this issue with my django based application. > > When a users changes its password, its active sessions are not destroyed. > I mean, if a user is logged in two different places (or in two different > b

Invalidating active sessions after a password change?

2012-10-02 Thread Dirley
I've recently discovered this issue with my django based application. When a users changes its password, its active sessions are not destroyed. I mean, if a user is logged in two different places (or in two different browsers) and changes its password on one place, the other session will sti

Re: Using sessions in Django

2012-08-17 Thread Sandeep kaur
On Fri, Aug 17, 2012 at 1:28 PM, Sandeep kaur wrote: > I am using session foreign key in my table. > if not request.session.exists(request.session.session_key): > request.session.create() > profile.sess = request.session.session_key > pro

Re: Using sessions in Django

2012-08-17 Thread Amyth Arora
You're Welcome. Glad to Help. On Fri, Aug 17, 2012 at 2:28 PM, Sandeep kaur wrote: > On Fri, Aug 17, 2012 at 1:39 PM, Amyth Arora > wrote: >> I think this is because you are passing it the "Session Key" instead >> of the "Session Instance", you need to get the session instance and >> then pass

Re: Using sessions in Django

2012-08-17 Thread Sandeep kaur
On Fri, Aug 17, 2012 at 1:39 PM, Amyth Arora wrote: > I think this is because you are passing it the "Session Key" instead > of the "Session Instance", you need to get the session instance and > then pass it to your function, Something like this: > > profile.sess = Session.objects.get(session_key

Re: Using sessions in Django

2012-08-17 Thread Thomas Orozco
My mistake then, sorry about that! Le 17 août 2012 10:34, "Tom Evans" a écrit : > On Fri, Aug 17, 2012 at 9:12 AM, Thomas Orozco > wrote: > > Session key is the session 's primary key. Not the session itself. > > > > What you want to assign to your field is a session, not its key. So use > > req

Re: Using sessions in Django

2012-08-17 Thread Tom Evans
On Fri, Aug 17, 2012 at 9:12 AM, Thomas Orozco wrote: > Session key is the session 's primary key. Not the session itself. > > What you want to assign to your field is a session, not its key. So use > request.session. > This would not work; request.session is a django.contrib.sessions.backends,Se

Re: Using sessions in Django

2012-08-17 Thread Thomas Orozco
7;s primary key. Not the session itself. > > > > What you want to assign to your field is a session, not its key. So use > > request.session. > > > > However. > > > > Please very careful when using FK' s to sessions, sessions are meant to > be >

Re: Using sessions in Django

2012-08-17 Thread Sandeep kaur
On Fri, Aug 17, 2012 at 1:42 PM, Thomas Orozco wrote: > Session key is the session 's primary key. Not the session itself. > > What you want to assign to your field is a session, not its key. So use > request.session. > > However. > > Please very careful when using FK

Re: Using sessions in Django

2012-08-17 Thread Thomas Orozco
Session key is the session 's primary key. Not the session itself. What you want to assign to your field is a session, not its key. So use request.session. However. Please very careful when using FK' s to sessions, sessions are meant to be short lived, and could / should be deleted

Re: Using sessions in Django

2012-08-17 Thread Amyth Arora
ession_key > profile.save() > > But when I execute my form and click on submit button, I get error as : > > ```Cannot assign "'b593c61453d7aad199078c66b9ad6b30'": > "ClientJob.sess" must be a "Session" instance. > > I a

Using sessions in Django

2012-08-17 Thread Sandeep kaur
: ```Cannot assign "'b593c61453d7aad199078c66b9ad6b30'": "ClientJob.sess" must be a "Session" instance. I am a bit unclear about using sessions in django, so be a little elaborative. Thank you. -- Sandeep Kaur E-Mail: mkaurkha...@gmail.com Blog: san

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Kurtis Mullins
On Thu, Aug 2, 2012 at 10:57 AM, Gregory Thompson Jr. < spockthompso...@gmail.com> wrote: > Thanks a load! You've cleared up a lot! > > Yes, I have read through the tutorial. I even wrote a shortened version > of it to act as notes as I learn: http://polydoo.com/code/?p=48 (my > blog) > > Than

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.
t' : text} >> return render_to_response('C:/Documents and >> Settings/quansai/projects/textsite/templates/results.html', c) >> >> >> I really don't understand the following, and I've read the documentation >> over and over. I've be

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Marcin Tustin
This is how you store data: request.session['member_id'] = m.id This is how you read it: request.session['member_id'] Your view code looks fine, in respect of how you use sessions. I can't see that you have explained what problem you are having: what is going wrong? F

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Daniel Roseman
does that work? > > They don't tell you where the session is started, how, what the scope of > the session declaration is, etc... > > > http://www.youtube.com/watch?v=YFd9NLZFmvo&playnext=1&list=PL6CB0A9FA1D9C736A&feature=results_video > > > > See th

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Kurtis Mullins
dex.html', c) > def results(request): > text = request.session.get('text', None) > c = {'text' : text} > return render_to_response('C:/Documents and > Settings/quansai/projects/textsite/templates/results.html', c) > > > I reall

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.
27;s confusing about this? You don't explicitly create sessions, and > they last as long as they are configured to last, which by default is until > the session cookie is cleared. > > On Thu, Aug 2, 2012 at 10:31 AM, Gregory Thompson Jr. < > spockthompso...@gmail.c

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Marcin Tustin
What's confusing about this? You don't explicitly create sessions, and they last as long as they are configured to last, which by default is until the session cookie is cleared. On Thu, Aug 2, 2012 at 10:31 AM, Gregory Thompson Jr. < spockthompso...@gmail.com> wrote: > >

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.
LZFmvo&playnext=1&list=PL6CB0A9FA1D9C736A&feature=results_video See that video? The video shows you how to use sessions very quickly. How did the person in the video get ALL of that code from just the documentation? If all readers in this thread and kindly tackle each point I

  1   2   3   4   >