codeigniter-php session transfer between pages

Source: Internet
Author: User
Tags session id

Problems with PHP session passing between pages:
Premise: Using the CodeIgniter framework, use PHP's own session
1. No problem on the pure Apache server
2. In the Nginx Apache mode, the page independent of the CodeIgniter frame is no problem
3. In the Nginx Apache mode, placed in the CodeIgniter frame of the page, the page between the passing of the session problem, that is, a page setup session, another page can not read to the previous Page Setup session

Nginx Apache mode: Lnamp environment, direct access to 8889 port, basically equal to ignore Nginx directly access Apache. Using Lumanager

In Nginx Apache mode, pages independent of the CodeIgniter frame are no problem

In the Nginx Apache mode, placed in the CodeIgniter frame of the page, the page between the passing of the session problem, that is, a page setup session, another page can not read to the previous Page Setup session

Reply content:

Problems with PHP session passing between pages:
Premise: Using the CodeIgniter framework, use PHP's own session
1. No problem on the pure Apache server
2. In the Nginx Apache mode, the page independent of the CodeIgniter frame is no problem
3. In the Nginx Apache mode, placed in the CodeIgniter frame of the page, the page between the passing of the session problem, that is, a page setup session, another page can not read to the previous Page Setup session

Nginx Apache mode: Lnamp environment, direct access to 8889 port, basically equal to ignore Nginx directly access Apache. Using Lumanager

In Nginx Apache mode, pages independent of the CodeIgniter frame are no problem

In the Nginx Apache mode, placed in the CodeIgniter frame of the page, the page between the passing of the session problem, that is, a page setup session, another page can not read to the previous Page Setup session

PHP passes between each request is the session ID, nothing more than three ways:

    1. Pass the session ID via the cookie header in the HTTP request
    2. Pass the session ID via an HTTP GET request, i.e. place the session ID in the URL parameter
    3. Pass the session ID via an HTTP POST request, i.e. pass the session ID to the post data

In my own blog, I wrote an article on the nature of PHP session in conjunction with HTTP-the nature of the session you have to understand.

If you are interested, you can read it carefully, if you find anything wrong, you can put it in the comments, I will check to correct. Want to share your technical ideas with more like-minded friends.

Why not put the contents of the session into the memcache?
First of all, this method belongs to the third party, there is no exception between the platform to get the session, the second can set the precise expiration time, and the access speed is very fast, and the data does not fall, do not have to consider the original session of the file storage mode caused by the trouble and put into the database of the problem of access speed If the traffic is not large, a 64G memory server can be done, brother humble opinion, please correct me.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.