1. session Random thoughts

HTTP stateless , in other words , Each request is a separate thread . The statelessness here actually means isolation . For example, a shopping cart , You choose first A goods , Add to cart , Here is the A Threads , And then choose B Commodities are B Threads . But each thread is independent ( For containers ,A and B Become a different user ), Threads A I didn't know there were threads B, Threads B I don't know about threads A, Now the problem is , How to pay together ?

How to save the status of multiple requests of the same user ? Associated with conversation , Use HttpSession Save the session state of multiple requests from a user .

HttpSession -> Containers ( The server ) Storage session , The disadvantage is that it can't be used in Distributed Systems .

2. session Mechanism

session Represents a session between the client and the server , until session invalid , Or the server is shut down , Or when the client closes .

session Store on the server , adopt SessionId To distinguish users from different clients ,Session In order to Cookie Technology or URL Rewrite the implementation . Default to Cookie Realization , The server will create a JSESSIONID Of Cookie value .

Hello session More articles about

  1. session Realize shopping cart

    To achieve a simple shopping function ( Shopping cart add . Account view . Shopping cart item delete . Real time calculation and display of the quantity and price of shopping goods . The number of items in the shopping cart can be manually entered ), use session It realizes a simple method to php Language is the foundation . Connect MySQL The purchase of database ...

  2. Asp.net Core Use in Session

    Preface 2017 The year began quietly ,2017 It's a very important year for me . New year's Day holiday at home to write a Asp.net Core Verification code login , do demo There are two small problems in the process , The first is in Asp.net Cor ...

  3. Lazy loading session Unable to open no session or session was closed terms of settlement ( Perfect solution )

            Let's start with ,hibernate Delay loading characteristics of (lazy). The so-called delayed loading is to perform the data loading operation only when the data needs to be queried . because hibernate It supports entity objects , Foreign keys are associated with entity objects . Such as ...

  4. Explore ASP.NET MVC5 Series of ~~~6.Session piece ( Out of process Session)

    In fact, any knowledge point in any data doesn't matter , It doesn't matter , The important thing is the learning method , The process of self exploration ( You are welcome to correct the mistakes ) Summary :http://www.cnblogs.com/dunitian/p/4822808.ht ...

  5. Nhibernate Of Session management

    Reference resources :http://www.cnblogs.com/renrenqq/archive/2006/08/04/467688.html But this method can't solve it yet Session The cache problem , Because of the creation of Session Need to be ...

  6. nginx+iis+redis+Task.MainForm Build a distributed architecture And (redis Storing distributed shared session And share session Operation process )

    This time share is to use windows+nginx+iis+redis+Task.MainForm Build a distributed architecture , The last sharing article was made in windows The use of nginx, It's usually officially released in linux Matching ...

  7. zookeeper Source analysis six session Mechanism

    zookeeper in session It means a physical connection , After the client successfully connects to the server , Will send a connection request , There will be session  produce . session from sessionTracker Produced ,sessio ...

  8. [ Reprint ]Cookie/Session The mechanism and security of

    Cookie and Session It's for the sake of being in the stateless HTTP Maintain session state over protocol , So that the server can know which client is dealing with . This paper discusses in detail Cookie and Session Implementation mechanism , And the security issues involved . because ...

  9. modify session Garbage collection probability

    <?php // modify session Garbage collection probability ini_set('session.gc_probability','1'); ini_set('session.gc_divisor','2'); ...

  10. Nginx Reverse proxy , Load balancing ,redis session share ,keepalived High availability

    Search for relevant knowledge by yourself , Direct delivery of dry goods ... Resources used : nginx One main server ,nginx One standby server , Use keepalived Switch down . tomcat Two servers , from nginx Reverse proxy and load balancing , this ...

Random recommendation

  1. Python class ( One )

    Let's have an abstract understanding of the class and instance first The definition of a class From a specific programming point of view : A class is a data structure . We can use classes to define objects that contain data values and behavior properties ( Class object ). Classes are another form of encapsulating logic and data . Object oriented design view ...

  2. hadoop Environment building

    osubtu16.04( standalone mode ), Storage space 25G, Memory 2G What about the code (!!) 1: Task list Reference books ,(hadoop3 Authoritative guide ) ( Environmental Science ( System macos12,java18101 ,hadoop173, ...

  3. HTML5 Time to drag ondragstart

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. solve IIS6.0 Can't download EXE The magic recipe for documentation !

    2003 System IIS6 Station building Yes EXE File download But it's not allowed to download . When I delete the station and rebuild it, I can download it , But it won't be allowed to download after a while . another ,MIME Are there in EXE the ! May I ask why ? How to deal with ? answer : win2003 Server allows ...

  5. Pass value UI Test knowledge points

    Pass value : 1. The attribute values : Before and after 2. Proxy transfer : From back to front 3. block: 4. Single case : Common writing and GCD How to write it 5 . notice NSNotification GCD Single case : static PlayMu ...

  6. Use read(),write(),seekg(),seekp() Implementation of binary file random access

    // binary.cpp -- binary file I/O #include <iostream> #include <fstream> #include <iom ...

  7. Shell Script practice

    1. The script determines whether the command output is empty (1) Judge that the string is empty if [ "$str" =  "" ]  if [ x"$str" = x ] if ...

  8. shell Start and stop scripts

    The startup script start_kmeans_v3.sh #!/bin/bash # be used for kmeans_data_v3_hadle start-up ps -ef | grep kmeans_data_v3_hadle.py ...

  9. tablespace( Table space ) / segment( break ) / extent( Panel )/ block( block )/datafile( file ) The relationship between

    tablespace( Table space ) / segment( break ) / extent( Panel )/ block( block ) The relationship between   tablespace : A database is divided into one or more table logical units , The table space , Each table is empty ...

  10. Introduction to machine learning - Text features -word2vec Word vector model 1.word2vec( Conduct word2vec Mapping code )2.model.wv[&#39;sky&#39;] Output the vector map of the word 3.model.wv.index2vec( Output mapped word names )

    Function description : 1. from gensim.model import word2vec  Build the model word2vec(corpus_token, size=feature_size, min_count ...