Hyperlink url does not open without opening a link or parent page

- I have a link to work

https://sjobs.brassring.com/TGWebHost/jobdetails.aspx?SID=%5eNJ9jpo3wVSbfK0NxdHECJijC2rWHbZl4%2f7afCQpgRyliOu2Weq1%2few7zT1iEt2vW&jobId=804091&type=search&JobReqLang=1&recordstart=1&JobSiteId=5011&JobSiteInfo=804091_5011&GQId=1640

-When I paste it into the browser URL and press enter, it leads to

ErrMsg = NoCookieGetSessionIdForXML (page does not load)

-However, in the same browser, if I open its link or parent page

https://sjobs.brassring.com/TGWebHost/searchopenings.aspx?partnerid=25222&siteid=5011

-Open a new tab, again in the same browser, I will go to the same link above

https://sjobs.brassring.com/TGWebHost/jobdetails.aspx?SID=%5eNJ9jpo3wVSbfK0NxdHECJijC2rWHbZl4%2f7afCQpgRyliOu2Weq1%2few7zT1iEt2vW&jobId=804091&type=search&JobReqLang=1&recordstart=1&JobSiteId=5011&JobSiteInfo=804091_5011&GQId=1640

This time the page loaded successfully. I clear the jobdetails URLs (not the search engine URLs) and present them to users on my own page. So can you tell me how to achieve this? I tried to solve the problem, and I think that this may be due to the creation of the session / cookies, but still can not understand everything. Thanks in advance for any help.

+5
source share
1 answer

The problem is that the user is missing the appropriate cookie, as stated in the comments and another answer. However, you don’t have to go to such complicated lengths to pull out a cookie from a remote source, you can simply load the resource from this site into your html. Downloading the resource will set the cookie in the users browser. Thus, when the user clicks on the link, they already have a cookie.

In the example below, I load the parent page into a hidden iframe, but if you find that the image also loads a cookie, you can simply add this without worrying about the iframe.

<iframe src="https://sjobs.brassring.com/TGWebHost/searchopenings.aspx?partnerid=25222&siteid=5011" style="display:none"></iframe> <a href="https://sjobs.brassring.com/TGWebHost/jobdetails.aspx?SID=%5eHN7W7Qzw%2fF7gatWoBM6cE0ccmSO%2fucQkl75UsUrOYMnVywG9mXDR2RR1QJ0dl_slp_rhc_16&jobId=790214&type=search&JobReqLang=1&recordstart=1&JobSiteId=5011&JobSiteInfo=790214_5011&GQId=1640">Because the hidden iframe adds the cookie, this link works now!!</a> 
+1
source

Source: https://habr.com/ru/post/1258376/


All Articles