Session, get the string value, always get images type

Source: Internet
Author: User
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) Gets an ID number, but the output is always images
Direct output echo $this->uri->segment (3), ID number no problem

Then do not use frames, directly
Session_Start ();
$_session["UUID"]= $uuid;

echo $_session["UUID"];
This way, the obtained value is still images


Reply to discussion (solution)

$uuid = (String) ($this->uri->segment (3));
Echo $uuid;
Look what it is.

$uuid = (String) ($this->uri->segment (3));
Echo $uuid;
Look what it is.

That's the ID string, right. Now the problem is to turn into a images after the session.

Session_Start ();
$_session["UUID"]= $uuid;

echo $_session["UUID"];
This way, the obtained value is still images

The method of storing the session with the original ecological storage is images that means you have images. Is it your variable name that's conflicting?

Don't think you've found any bugs in PHP.
Wrong definitely in you instead of PHP


$uuid = (String) ($this->uri->segment (3));
Echo $uuid;
Look what it is.

That's the ID string, right. Now the problem is to turn into a images after the session.

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

I have questions to ask LZ, how do you determine "always get images type"
Var_dump? Look at the header? Binary file header? Or just a little echo, you know.

I have questions to ask LZ, how do you determine "always get images type"
Var_dump? Look at the header? Binary file header? Or just a little echo, you know.

Not sure "Always get images type", but to be sure that Echo appears is the string "images"

LZ I bet five cents,
Must be $_session[' UUID '] was reset.
Or the $uuid is reset.
Want to see what is inside the session directly to the session storage directory to take that file to see.
or direct var_dump ($_session) inside all the look.
Or not, it must be that $uuid was reset.

Http://stackoverflow.com/questions/5484429/codeigniter-session-value-as-images, it's settled.

show no problem in the same action
But jumps to other actions Print_r ($this->uri->segment_array ()), and the value changes to images

After using Set_userdata, use redirect redirection
Other actions with Print_r ($this->uri->segment_array ()), the value is finally not images

Hack method, Orz

Don't think you've found any bugs in PHP.
Wrong definitely in you instead of PHP



$uuid = (String) ($this->uri->segment (3));
Echo $uuid;
Look what it is.

That's the ID string, right. Now the problem is to turn into a images after the session.

Never said that I found a bug, but there is a 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.