cookies

How to structure database for unread item alerts per user

旧城冷巷雨未停 提交于 2020-11-30 12:40:26
问题 I just have a general database theory question. I have a need to make something similar to showing what posts/items a user has viewed or not (such as in a forum) or an unread email message. What I have is there are posts that multiple users can view, but it needs to separate by user who has actually viewed it. So if User A viewed Post 1, it would no longer show that Post 1 is a new item to view, but to User B, it would still show that Post 1 is a new item to view. I've search for other ideas

Django-rest-auth use cookie instead of Authorization header

让人想犯罪 __ 提交于 2020-11-30 12:01:34
问题 I want to build the SPA application using Django Rest Framework as a back-end. The application will use Token authentication. For maximum security, I want to store the authentication token inside of httpOnly cookie, so it will not be accessible from javascript. However, because the cookie is not accessible from the javascript, I am not able to set the 'Authorization: Token ...' header. So, my question is, can I make the DRF auth system (or Django-Rest-Knox/Django-Rest-JWT) to read the

Samesite for jessessionId cookie can be set only from response

你。 提交于 2020-11-29 23:44:20
问题 I am trying to set samesite none; secure for my jsessionid cookie from java filter . I have added this in response set cookie header.After this change the request cookie jsessionId is same . In the response the jsessionId is modified with Samesite attribute None and secure. Will it work if the request jsessionId cookie remains unchanged. 回答1: A call to ServletResponse methods: sendError, getWrite.flush(), sendRedirect, getOutputStream.Flush commits the response, meaning the status code and