Questions about the session code written in thinkphp

Source: Internet
Author: User
Ask thinkphp to write the code session. the code is like this & nbsp; public & nbsp; function & nbsp; index () {$ namecookie (name ); $ messgetuserlink (); $ id]; session (addressid, $ id); coo asks questions about the session code written in thinkphp
The code is like this

Public function index (){
$ Name = cookie ('name ');

$ Mess = getuserlink ();

$ Id = $ _ GET ['id'];

Session ('ssid SSID ', $ id );
Cookies ("goodsid", $ id, 3600000 );

Dump (session ('address '));
Dump (cookie ('goodsid '));

In fact, it is to save the id parameter to the session for use on other pages, and it has been confirmed correct by using dump.
The result is as follows:
String (32) "88d2a7d29f90075584073212a2883ab8"
String (32) "88d2a7d29f90075584073212a2883ab8"

But after a page is changed

Public function index (){

$ Name = cookie ('name ');

$ Mess = getuserlink ();

If (is_null ($ name )){
$ Name = fy ('tourists ');
}

Dump (session ("addressid "));

Echo ("======= cookie
");
Echo (cookie ("goodsid "));
Echo ("======= cookie ");
The displayed result is
String (71) "templatesquare & count = 1 & callback = jquery16409371740901_102_14208544222"
======= Cookie
Templatesquare & count = 1 & callback = jquery16409371740901_102_1420208544222 ====== cookie

Does anyone know what is going on?
------ Solution ----------------------
String (71) "templatesquare & count = 1 & callback = jquery16409371740901_102_14208544222"
======= Cookie
Templatesquare & count = 1 & callback = jquery16409371740901_102_1420208544222 ====== cookie

Excuse me, are you two different?
------ Solution ----------------------
String (71) "templatesquare & count = 1 & callback = jquery16409371740901_102_14208544222"
======= Cookie
Templatesquare & count = 1 & callback = jquery16409371740901_102_1420208544222 ====== cookie

Same.
------ Solution ----------------------
You didn't get it. how can you see it?
That is the url parameter of the jquery jsonp request.

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.