Timeline for How to fetch HttpOnly cookie value in LWC?
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 4, 2023 at 15:58 | comment | added | sfdcfox♦ | @DhananjayPatil The cookies are controlled by the service that set the cookie. That service must be configured to not set an Expires attribute on the cookie, which will tell the browser that it is a session cookie, which will be cleared when the browser is closed. | |
Jul 4, 2023 at 12:25 | comment | added | SFDCDJ | When it sets the expid value in cookie, it by default sets expiry date as 1 month from current date. Is there a way to control this? e.g. If I close the browser and this time if I do not pass anything, it still refers existing cookie value. If I clear cookies then only it works as expected but clearing cookies from browser is not possible. So basically if is there a way to set expiry date of this cookie ? developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/… | |
Jul 4, 2023 at 10:31 | comment | added | SFDCDJ | The only problem is it does not clear cookies. If I close the browser and try again without expid value, it still refers old cookie values. | |
Jul 4, 2023 at 8:57 | comment | added | SFDCDJ | I have found possible workaround for this. From LWC , I am calling Controller class and In controller I just added System.Site.getExperienceId() and returning the same and I am able to read the value perfectly! | |
Jul 3, 2023 at 15:44 | history | answered | sfdcfox♦ | CC BY-SA 4.0 |