Skip to content
This repository was archived by the owner on Aug 21, 2020. It is now read-only.
This repository was archived by the owner on Aug 21, 2020. It is now read-only.

Using secure property for cookie #45

Open

Description

@owlstack

Hi @salemdar

I have a question. I'm using angular2-cookie in my application and I want to make my cookies secure, or preferably, encrypted, so the data in the cookie is not sent as plaintext. I'm noticing if I use the secure = true property, the cookie doesn't seem secure. It's still sent as plaintext. Is this the expected behavior for the cookie? If so, why? and how can I make the cookie more secure in this case via encryption or alternative method? Can I also set HttpOnly?

Activity

  1. robert-cahoon commented on Feb 15, 2017

    @robert-cahoon

    Setting the secure flag on a cookie doesn't, in and of itself, result in it being encrypted. The secure flag is read by the browser when it is constructing its header. Secure cookies are only included int he headers when using an encrypted connection, i.e. https. If the connection is not encrypted, the browser will not send secure cookies. So the secure flag doesn't encrypt the cookie, it just ensures that it will only ever be sent if the connection is encrypted. subtle but important difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions