最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

http - Set Cookie for a regex path - Stack Overflow

programmeradmin3浏览0评论

I want to set cookie for a path that matches an exact regex. For example, consider that I have the below APIs

sample/resource
sample/resource/1234  *(here, '1234' is resource's id)*
sample/resource/1234/action

Here, I want to send a cookie from the site for the first and third APIs. But, When going through cookie's documentation, I believe it is impossible to set cookie for a regex path.

Is there any workaround for this? or if it is completely impossible, I want to atleast send a cookie for 2nd API alone. But, I can't do that as the resource's id is not static and can be any number. Thanks in advance.

发布评论

评论列表(0)

  1. 暂无评论