It may be if you want to always clean everything in the session (auth info 
etc.)

On Monday, 24 September 2012 03:04:24 UTC-5, Yebach wrote:
>
> If I put session.clear() into the controler of the default page it works
>
> Is that I good solution? It is true that a user has to log in again but it 
> kind of works
>
> On Monday, September 24, 2012 8:48:03 AM UTC+2, Yebach wrote:
>>
>> Where do I insert the code? In model?
>>
>> this is now my code in db.py
>>
>> if session['school_db'] != request.cookies['mycookie'].value:
>>         auth.logout()
>>         session['school_db'] = request.cookies['mycookie'].value
>>
>> But I get an error 
>> 'NoneType' object has no attribute 'insert'
>>
>> seems like smth is wrong with auth.logout()
>>
>> On Friday, September 21, 2012 6:03:59 PM UTC+2, Massimo Di Pierro wrote:
>>>
>>> After login your user info is loaded into session. You need to add 
>>> something like
>>>
>>> if session.dbname != current_db_name:
>>>     auth.logout()
>>>     session.dbname = current_db_name
>>>
>>>
>>> On Friday, 21 September 2012 07:47:08 UTC-5, Yebach wrote:
>>>>
>>>> Hello
>>>>
>>>> You can see my app on portal.iurnik.si  <http://portal.urnik.si>
>>>>
>>>> I have the following problem 
>>>> after user selects a school app connects to a specific database where 
>>>> data is read from. On that database the auth tables are created so 
>>>> registered users can download some documents.
>>>> The problems occurs if I log in on one school (database) and then I go 
>>>> back to main page, select a new database I am already logged in. How?? I 
>>>> mean auth tables are created on db but the user is not. How can I solve 
>>>> this?
>>>>
>>>> I am reading database name from cookie
>>>>
>>>> Thank you
>>>>
>>>>
>>>>

-- 



Reply via email to