Session-php Tutorial

Source: Internet
Author: User
For a session with minor issues, will the session disappear as long as I keep requesting the server?


Reply to discussion (solution)

Why does the session disappear? When you request the server, sessionid is generated, and the storage method is cookie or memory.

Why does the session disappear? When you request the server, sessionid is generated, and the storage method is cookie or memory.

I also encountered this problem. Do I have to access the session before it will expire? or do I have to access the php page without being invalidated?

It seems that as long as you access the server within the validity period of the Session, the validity period will be extended again.
Try it at night.

The same browser process keeps requesting the server, and the session will not disappear.
Note:
Changing the process in the same browser disappears.
If the interval exceeds the setting in php. ini, it may disappear.

The same browser process keeps requesting the server, and the session will not disappear.
Note:
Changing the process in the same browser disappears.
If the interval exceeds the setting in php. ini, it may disappear.

It is useless to request static pages. Must it be a php page or session_start () for a php page ()

Follow the results and learn together

I haven't learned this yet.

It is useless to request static pages. Must it be a php page or session_start () for a php page ()
Yes
Session is a function provided by server scripts. you must start it explicitly.

1. close the browser will disappear.
2. if the browser is opened, but no server request is performed for a period of time (beyond the session timeout time), the request will disappear.
3. if the browser is always open and there are requests (the time interval is less than the timeout time), the request will not disappear.

We recommend that you check the session lifetime.

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.