Atitit. session principle and similarities and differences in java php implementation, atitit. sessionjava

Source: Internet
Author: User
Tags php session php error

Atitit. session principle and similarities and differences in java php implementation, atitit. sessionjava

Atitit. session principle and similarities and differences in java php implementation

 

1. session storage: java is in the memory. Because php scripts cannot be resident in the memory

2. php session mechanism 1

2.1. method 1 for Undefined variable: _ SESSION

2.2. Notice: A session had already been starte solution 2

3. Reference 3

 

1. session storage: java is in the memory, and php scripts are stored in files because they cannot be resident in the memory.

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 iron, EMAIL: 1466519819@qq.com

Reprinted please indicate Source: http://blog.csdn.net/attilax

 

 

2. php session mechanism

 

2.1. Solution to Undefined variable: _ SESSION

(17:10:10)

Reprinted token

 

 

This article describes how to solve SESSION errors in PHP. For those who use the session for the first time, the error such as Undefined variable: _ SESSION may occur because the session is not enabled. Because the session in php is disabled by default, it must be enabled in the program before it can be used. PHP error: PHP Notice: Undefined variable: _ SESSION cause and Solution

The cause of the Undefined variable: _ SESSION error is that the php session is not enabled.

There are two solutions below.

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 when 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 use this line

If (! Session_id () session_start ();

Instead

Session_start ();

 

3. Reference

Solve the Problem of Undefined variable _session_abc123_sina blog .htm

 

Php sets the session lifecycle-columns in northstar888-blog channel-CSDN.NET.htm

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.