Session, the string value obtained, always get the images type

Source: Internet
Author: User
Session, the string value obtained, always gets the images type using the ci framework, version 2.1.4

$ Uuid = (string) ($ this-> uri-> segment (3 ));

$ Data = array (
'Uuid' => $ uuid
);

$ This-> session-> set_userdata ('uuid', $ data );

Echo $ this-> session-> userdata ('uuid ');

Problem:
$ This-> uri-> segment (3) obtains an ID number, but the output is always images.
Directly output echo $ this-> uri-> segment (3). The id is correct.

Then, without using the framework, directly
Session_start ();
$ _ SESSION ["uuid"] = $ uuid;

Echo $ _ SESSION ["uuid"];
In this way, the obtained value is still images.


Reply to discussion (solution)

$ Uuid = (string) ($ this-> uri-> segment (3 ));
Echo $ uuid;
See what it is

$ Uuid = (string) ($ this-> uri-> segment (3 ));
Echo $ uuid;
See what it is

The ID string is correct. Now the problem is that the session becomes images.

Session_start ();
$ _ SESSION ["uuid"] = $ uuid;

Echo $ _ SESSION ["uuid"];
In this way, the obtained value is still images.

The original storage session method is used to store images. that means you saved images. Is it because your variable name is in conflict?

Don't think you have discovered any bugs in php
The mistake must be on you, not on php.


$ Uuid = (string) ($ this-> uri-> segment (3 ));
Echo $ uuid;
See what it is

The ID string is correct. Now the problem is that the session becomes images.

print_r($this->uri->segment_array())

If you have any questions, ask LZ, how do you determine "always get the images type"
Var_dump? Check the header? Binary file header? Just echo.

If you have any questions, ask LZ, how do you determine "always get the images type"
Var_dump? Check the header? Binary file header? Just echo.

Not sure "always get images type", but sure that the echo string appears is "images"

Lz I bet five cents,
It must have been $ _ SESSION ['uuid'] reset.
Or $ uuid is reset ..
I want to see what is in the session and directly go to the session storage directory to find the file.
Or directly look at all the information in var_dump ($ _ SESSION.
No, it must have been $ uuid reset.

Bytes

Show no problem in the same action
However, in other actions, the value of print_r ($ this-> uri-> segment_array () is changed to images.

Use redirect redirection after set_userdata is used
Print_r ($ this-> uri-> segment_array () is used in other actions, and the value is not images.

Hack method, orz

Don't think you have discovered any bugs in php
The mistake must be on you, not on php.



$ Uuid = (string) ($ this-> uri-> segment (3 ));
Echo $ uuid;
See what it is

The ID string is correct. Now the problem is that the session becomes images.

I have never said that I have found any bugs, but there is one thing called abstract vulnerability.

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.