Jump to content

How To Get Cookie Value with APath parameter


i2u4ever

Recommended Posts

  When Setting a cookie value with a path parameter, the value cannot be read.

 

  For Example,

 

  UniApplication.Cookies.SetCookie('_test1', 'can be read', Date+7.0);

  UniApplication.Cookies.SetCookie('_test2', 'can not be read', Date+7.0, false, false, '/app1/app1.dll');

 

  UniApplication.Cookies.Values['_test1'];    //This can get the value

  UniApplication.Cookies.Values['_test2'];    //This cannot get the value

  UniApplication.Cookies.GetCookie('_test2'); //This cannot get the value

 

  How to get a cookie value with a path parameter?

 

  I am using regular version 0.99.96.1322

 

  Best Regards.

Link to comment
Share on other sites

Hi,

 

Try this:

UniApplication.Cookies.SetCookie('_test2', 'can not be read', Date+7.0, false, false, '/app1');

Best regards

 

Thanks.
I tried your code, but failed.
When a path parameter exists, uniGUI's GetCookie cannot read the cookie value. 
Only the root path '/' is allowed to get the cookie value.
 
When testing with "C:\Program Files\FMSoft\Framework\uniGUI\Demos\Desktop\Cookies Demo",
this demo also cannot get the cookie value after Setting Cookie with a path parameter like '/App1'
 
Please test again, and let me solve this problem.
 
Best Regards.
Link to comment
Share on other sites

Thanks, it works.

 

UniServerModule.UrlPath is set when design time only,

 

and cannot be changed at runtime.

 

Is there any other problem when UniServerModule.UrlPath is set with a some value as like '/App1'?

 

What is the function or role of the UniServerModule.UrlPath in uniGUI Application?

 

Best Regards.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...