Session, cookie sharing, and session loss

Source: Internet
Author: User
Tags php session
Session, cookie sharing, and session loss: one week. The cookie only saves one automatic logon. Session, which stores the name of the export column (Chinese/English name system ). There are nearly 30. For example, PHPcode $ session ['userinfo'] = 'User Center'; All sessions are in the head. php session, cookie sharing, and session loss. it has been one week.
The cookie only saves one automatic logon.
Session, which stores the name of the export column (Chinese/English name system ). There are nearly 30. For example:
PHP code
  $ Session ['userinfo'] = 'User Center ';

All sessions are in head. php and referenced by all files.
Some code is as follows:
PHP code
  
  Query ("select authority from setting_user where number = '". $ number. "'and password = '". $ pass. "'"); $ r = $ q-> fetch_array (MYSQLI_USE_RESULT); (int) $ authority = $ r ['authority']; // permission assignment if ($ q-> num_rows> 0) {// assign the display name $ qShow = $ m-> query ("select * from setting_display where user = '". $ number. "'Order by id desc limit 1"); $ rShow = $ qShow-> fetch_array (MYSQLI_USE_RESULT ); {$ _ SESSION ['Grouping '] = $ rShow ['Grouping ing']? $ RShow ['sorting ing']: NULL; $ _ SESSION ['Po'] = $ rShow ['Po']? $ RShow ['Po']: NULL; // many sessions here if ($ _ POST ['describerme']) {setcookie ("u", $ number, time () + 3600); setcookie ("p", $ pass, time () + 3600) ;}}$ _ SESSION ['auth'] = $ number; switch ($ authority) {case 1: echo "script window. location. href = 'main. php? O = show '; script "; $ _ SESSION ['admin'] = 1; break; default: echo" script window. location. href = 'main. php? O = show '; script "; $ _ SESSION ['admin'] = NULL; break;} else {echo"

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.