The website keeps SESSION calls. I manually delete all the cookies on the client. why is it still logged on when I access the website again?

Source: Internet
Author: User
I just got in touch with PHP for less than 3 months, and I got a noob ..... the trial website uses SESSION to keep SESSION calls. without closing the browser, I manually delete all cookie files on the client and refresh the website, found that the account is logged on... what's going on? As often as I do... I just got in touch with PHP for less than 3 months, and I got a noob ..... the trial website uses SESSION to keep SESSION calls. without closing the browser, I manually delete all cookie files on the client and refresh the website, found that the account is logged on... what's going on?

Some websites that I usually use usually exit the logon status as long as the cookies are cleared...

The following is the problem Code of the younger brother. please kindly advise me ..

Page A for processing login code

// Log on successfully. keep the logon status function login_true ($ username) {session_start (); $ _ SESSION ['userinfo'] = array ('uid' => 476283675, 'username' => $ username );}

Page B of the logon page is displayed.

/* If $ _ SESSION ['userinfo'] or $ _ SESSION ['userinfo'] ['uid'] is EMPTY *, it indicates that no logon is performed, bootstrap user logon */session_start (); if (empty ($ _ SESSION ['userinfo']) or empty ($ _ SESSION ['userinfo'] ['uid']) {echo "click my logon"; die ('log on first ');} echo 'good evening ';

After the cookie file is cleared, the logon status remains unchanged. what is the problem?

Reply content:

I just got in touch with PHP for less than 3 months, and I got a noob ..... the trial website uses SESSION to keep SESSION calls. without closing the browser, I manually delete all cookie files on the client and refresh the website, found that the account is logged on... what's going on?

Some websites that I usually use usually exit the logon status as long as the cookies are cleared...

The following is the problem Code of the younger brother. please kindly advise me ..

Page A for processing login code

// Log on successfully. keep the logon status function login_true ($ username) {session_start (); $ _ SESSION ['userinfo'] = array ('uid' => 476283675, 'username' => $ username );}

Page B of the logon page is displayed.

/* If $ _ SESSION ['userinfo'] or $ _ SESSION ['userinfo'] ['uid'] is EMPTY *, it indicates that no logon is performed, bootstrap user logon */session_start (); if (empty ($ _ SESSION ['userinfo']) or empty ($ _ SESSION ['userinfo'] ['uid']) {echo "click my logon"; die ('log on first ');} echo 'good evening ';

After the cookie file is cleared, the logon status remains unchanged. what is the problem?

Use the clear button that comes with the browser.

By default, the cookie is cleared successfully, and the sessionid stored in the cookie is no longer available. when a session is requested to the backend session mechanism, the sessionid cannot be obtained to obtain information from the corresponding session file. I don't know which loop is handling exceptions. Cookie not cleared? Is sessionid included in the request body in other forms?

A session stores a session by passing the session_id value during each request. There are two transmission methods: one is through cookies carried by each request, another method is to pass through the url. if you set cookies in php, the server will automatically generate a new session_id as long as the original cookies under the corresponding domain name are deleted, that is, the original session is lost. As for your problem, I think the deletion method is incorrect. since it is a developer, use the browser's opener tool, all cookies under the current domain name can be displayed or deleted. In addition, chrome is recommended for browsers!

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.