Questions about the range of sessions

Source: Internet
Author: User
Concerning the range of sessions, the session_start () and session_register () functions are used during user login. they are defined before the tag & lt; http & gt, the session_unregister () function is used to log out. it runs in & lt; body & gt. & Nbsp; questions about the range of sessions
The session_start () and session_register () functions used during user login are marked As defined earlier in, LOGOUT is the session_unregister () function, which is.



I wantTo determine whether a user is a legal user. If (isset ($ AB )&&! Empty ($ AB) is used to display a specific object, but the current situation is:

1. After I log out, if I click index. php on the address bar? AB = user and then enter the user's interface (the div part appears)

2. I did not log out, but when I go to another page and return again through that page, the user page disappears again. why?

Thank you.



Note: in a function, I use global $ AB when writing a function. Otherwise, I cannot log on to the function for the first time.

------ Solution --------------------
Did not understand. Answered by yourself?
------ Solution --------------------
I suspect that not the same person's operations ......
------ Solution --------------------
User logout. Yes.
Unset ($ _ SESSION );
------ Solution --------------------
For example, after you log on successfully,
$ _ SESSION ['admin'] = '***';
Logout:
Unset ($ _ SESSION ['admin']);

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.