[Cookie, Session] Use cookies to manage status, cookie header fields, session management and cookie applications

Cookies and Sessions are two mechanisms used to maintain state and implement user authentication in web applications. They solve the following problems: State management: HTTP is a stateless protocol. Each HTTP request is independent, and the server will not remember the status of the previous request. This can cause problems when building highly interactive web […]

Greedy Algorithm: Distributing Cookies, Swing Sequence, Maximum Subsequence Sum

1. Theoretical basis of greedy algorithm What is greed The essence of greed is to select the local optimum at each stage to achieve the global optimum. Greedy routine (when to use greedy) There is no fixed formula for greed. The only difficulty is how to derive the overall optimal through local optimal. The best […]

java: Manipulating cookies

Background Cookies are a client-side session technology that saves data to the client. The main process is: 1. The server sets the data to the cookie and returns it to the browser 2. Browser automatically saves 3. The browser automatically carries the cookie to the server the next time it sends a request. Let’s mainly […]

Session Technology Cookies and Session

1. Conversational technology 1. Concept Session: A session contains multiple requests and responses. A session: The browser sends a request to the server resource for the first time, and the session is established until one party disconnects. 2. Function Used to track and manage user status between multiple requests to achieve functions such as data […]

Cookies and Sessions

1.Cookie a) What are cookies Cookie is a technology that the server notifies the client to save key-value pairs. After the client has a cookie, each request is sent to the server The size of each cookie cannot exceed 4kb b) How to create cookies public class CookieServlet extends BaseServlet{ protected void createCookie(HttpServletRequest req, HttpServletResponse […]

Cookies and Sessions

1. What are cookies? 1. Cookie translates as cookie. 2. Cookie is a technology that the server notifies the client to save key-value pairs. 3. After the client has a cookie, each request is sent to the server. 4. The size of each cookie cannot exceed 4kb 2. How to create cookies Code in Servlet […]

Play with IndexedDB, a local cache on the web page that is more powerful than localStorage and cookies

As the functionality of browsers continues to increase, more and more websites begin to consider storing a large amount of data on the client, which reduces the need to obtain data from the server and directly obtains data locally. Existing browser data storage solutions are not suitable for storing large amounts of data: the size […]

The latest details in 2023: use selenium to carry cookies to log in to QQ space, crawl the specified friend space to talk about photos

Written in the front: I recently learned about reptiles, and I happened to crawl all the spaces of the designated friends to talk about photos. I used the selenium account password to log in before, and the number of simulated logins was too many. Verification codes would be added, and even QQ would freeze, so […]

requests module – use of cookies parameter

Carry cookie in headers parameter Websites often use the Cookie field in the request header to maintain the user’s access status, so we can add Cookie to the headers parameter to simulate the request of ordinary users. First, let’s understand how cookies are passed in HTTP requests. When a browser visits a website for the […]