The principle of atitit.session and the similarities and differences of Java PHP Implementation design

Source: Internet
Author: User
Tags php session php error

the principle of atitit.session and the similarities and differences of Java PHP implementation Design

1. Session Save:java in memory,php script because it cannot reside in memory, so in the file 1

2. the session mechanism of PHP 1

2.1. Solution to Undefined variable: _session method 1

2.2. Notice:a session had already been Starte solution 2

3. Reference 3

1. Sessionthe Save:Javain memory,PHPthe script cannot reside in memory, so in the file

2. Set Session.auto_start = 0 to Session.auto_start = 1 in php.ini

Session_Start ();

if (!session_id ()) session_start ();

$_session["AA"]= "aa22222";

D:\wamp\tmp\sess_5lcl1n9ct8v4en56qal8f4nm12

Aa|s:7: "aa22222";

Author:: Old Wow's paw attilax Ayron, email:[email protected]

Reprint please indicate source: Http://blog.csdn.net/attilax

2. phpof theSessionmechanism

2.1. Solution to undefined variable: _session method

(2013-04-11 17:10:10)

Reproduced

This article introduces how to solve the error in PHP using the session. For those who first use the session, they may encounter undefined variable: _session Such a mistake because the session was not opened. Because the session in PHP is not open by default, it needs to be opened in the program to use. PHP Error: PHP notice:undefined variable: _session Causes and solutions

Encountered undefined variable: _session error is due to the PHP SESSION is not open.

Here are two workarounds.

1. Add the Session_Start () function to the program

2. Set Session.auto_start = 0 to Session.auto_start = 1 in php.ini

2.2. Notice:a session had already been Starte solution

Notice:a session had already been started–ignoring session_start () in. On line..

This happens if you try to start session more than once.

The solution for above problem is

1) in php.ini file set Session.autostart to 0

Session.auto_start = 0

2) in your code with this line

if (!session_id ()) session_start ();

Instead of

Session_Start ();

3. Reference

Solution Undefined Variable _session method _ i abc123_ Sina blog . htm

PHP Settings session lifetime -northstar888 's Column - Blog channel -CSDN . Net.htm

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The principle of atitit.session and the similarities and differences of Java PHP Implementation design

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.