How to get cookie of nopcommerce by javascript

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 лет назад
How to get cookie of nopcommerce by javascript. I dont know how to get it?

I try to get it by many javascript but i can't get it
8 лет назад
I have also question of how to get nopcommerce customer cookie using javascript?
I have tried to many things to get cookies but did not succeed.
I think nopcommerce saves the cookies in httponly secure format so client side script did not read cokies values.
please help how to get it?
8 лет назад
faiz9092 wrote:
I have also question of how to get nopcommerce customer cookie using javascript?
I have tried to many things to get cookies but did not succeed.
I think nopcommerce saves the cookies in httponly secure format so client side script did not read cokies values.
please help how to get it?


Did you try with cookie name "Nop.customer"?
8 лет назад
Nop.Customer value save in http Mode.
If the HttpOnly flag (optional) is included in the HTTP response header, the cookie cannot be accessed through client side script (again if the browser supports this flag). As a result, even if a cross-site scripting (XSS) flaw exists, and a user accidentally accesses a link that exploits this flaw, the browser (primarily Internet Explorer) will not reveal the cookie to a third party.
8 лет назад
Go through the link http://stackoverflow.com/questions/35356739/how-to-get-value-from-cookie-which-http-mode-is-true
8 лет назад
I need to get the Cookie in my method and Decrypt the value how can i do this? i use decrypt method which i created but it throwing exeption. in Nop is there any facility to decrpt the encrypted cookie?
8 лет назад
protected virtual HttpCookie GetCustomerCookie()
        {
            if (_httpContext == null || _httpContext.Request == null)
                return null;

            return _httpContext.Request.Cookies["Nop.customer"];
        }

you can get that cookie by that in every request to server.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.