object
Cookies
Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clear(key: String): Unit
-
def
clone(): AnyRef
-
def
decode(s: String): String
-
def
encode(s: String): String
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
def
get(key: String): Option[String]
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
val
never: Some[Date]
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
set(key: String, value: String, expires: Option[Date] = None, secure: Option[Boolean] = None, maxAge: Option[Long] = None): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
Functions for manipulating the cookies that are set in the DOM.
Note this code, which seems to be the most complete solution, but is kind of insane:
https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie/Simple_document.cookie_framework
This provides some inspiration, but we're going to make the simplifying assumption (for now) that we are reading the same cookies we are writing, so we don't have to be as forgiving about formatting. (And we aren't going to abuse regular expressions so horribly.) PRs welcome to make this more forgiving.
At least for now, we are assuming that all cookies use the root path and current domain, which is typically appropriate for SPAs.
Note that both keys *and* values get encoded, so that things should be generally Unicode-safe.
NOTE: this code is not yet tested!