cancel
Showing results for 
Search instead for 
Did you mean: 

How to set a cookie in the browser from an html page called via an Iview

Former Member
0 Kudos

How to set a cookie in the browser from an html page called via an Iview

Hello all,

I have an issue which is causing problems. I have a snap survey (html form with submit and cookie setting) which is embedded in a url iview.

Although the submit and the form work fine, the portal will not allow the cookie to be set it seems.

Is there a way to allow cookies to be set from an embedded page in a url iview??

You will make my day if you know!

System: EP7 SP13

Kind regards

Alex

Accepted Solutions (1)

Accepted Solutions (1)

praveenkumar_gudapati
Active Contributor
0 Kudos

Hi,

Is your URL IView referencing some external site on some other domain.

The Same Origin Policy of cookies restrict cookies to be set from different domains.

So this could be the problem.

If your portal runs on help.sap.com, then even sap.com can set cookies, but google.com cannot.

Regards,

Praveen Gudapati

Former Member
0 Kudos

Thanks Praveen,

The html page which is attempting to set the cookie is located in a document repository folder on KM.

After some testing it seems when previewing the iview separately the cookie is allowd to be set, where as if I preview/load the page with the iview inside it does not allow it.

I have set page to embedded and to url but to no avail.

Any ideas?

Thanks

praveenkumar_gudapati
Active Contributor
0 Kudos

Hi,

If you are accessing HTML from KM, are your using the KM Doc IView path to assess in your URL IView?

go/km/docs/documents/myHtml.html

Did you also try directly with KM Doc IView, instead of URL IView, here ofcourse you have to replace all links to files in your HTML to go/km/docs/ path as they are in KM.

Let me know the hostname of your portal and what you type in URL IView.

Are you using Fully Qualifed Domain Name?

Regards,

Praveen Gudapati

Former Member
0 Kudos

Within the url Iview i have the following url:

/irj/go/km/docs/intranet_content/com.xyz.fl_comp/com.xyz.fl_voting/vote_form.htm

With the following url being the portal domain name:

http://portal.ad.xyzep.co.uk/irj/portal

The vote_form.htm is a survey form and links off to an external website for its scripts etc upon submit.

praveenkumar_gudapati
Active Contributor
0 Kudos

Hi,

Check this:

http://www.oracle.com/technology/products/ias/portal/html/same_cookie_domain_with_pdkv2.html

Cookie Basics

Web browsers have built in rules for receiving and sending cookies. When a browser makes a request to a web server and the web server returns cookies with the response, the browser will only accept a cookie if the domain associated with the cookie matches that of the original request. Similarly, when a browser makes a subsequent request, it will only send those cookies whose domain matches that of the target web server.

These rules are designed to ensure that information encoded in cookies is only "seen" by the web server(s) that the originator of the cookie intended. These rules also ensure that the cookie cannot be corrupted or imitated by another server. By default, the domain associated with a cookie exactly matches that of the server that created it. However, it is possible to modify the domain at the time the cookie is created. Relaxing the cookie domain increases the scope of the cookie's visibility making it available to a wider "audience" of web servers.

For example, if a cookie is created by a.us.oracle.com, it's domain will usually be set to a.us.oracle.com. This means that the browser will only send the cookie to a.us.oracle.com. It will never send it to any other servers. However, if at the time of creation, the domain of the cookie is set to .us.oracle.com, the browser will send the cookie to any server whose domain falls within .us.oracle.com. such as portal.us.oracle.com, provider.us.oracle.com, app.us.oracle.com etc

Regards,

Praveen Gudapati

Answers (0)