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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...