score:3
Accepted answer
its not a good idea to remove or change the session from the javascript, because "Play Framework uses stateless sessions". There is no state stored on the server side, rather, all the state is stored in the session cookie. To validate a session, Play signs the sessions using a secret key, and validates the signature when a request with a session cookie arrives. If cookie was modified from the javascirpt, then the signature would not match, and so Play would reject the session cookie.
so its better that you change it from your server side.
in scala
Ok("Bye").withNewSession
in java
session().clear();
Source: stackoverflow.com
Related Query
- Clear session value in scala
- Play framework Scala - get session value in a form
- Scala Play session value not saving
- What is the motivation for Scala assignment evaluating to Unit rather than the value assigned?
- Accessing value returned by scala futures
- how to remove key value from map in scala
- Scala case match default value
- Scala: How can I replace value in Dataframes using scala
- Scala safe way of converting String to Enumeration value
- Overriding Scala Enumeration Value
- How to clear all variables in Scala REPL
- Scala case class update value
- How to check that an array contains a particular value in Scala 2.8?
- Mockito matchers, scala value class and NullPointerException
- Get all entries having a value from List[Option] in Scala
- Default value for type parameter in Scala
- Scala Java Error: value filter is not a member of java.util.Map. Works outside of class
- how to keep return value when logging in scala
- scala - error: not found: value
- recursive value yyy needs type in scala
- Scala return value from onComplete
- Is it possible for an optional argument value to depend on another argument in Scala
- How map only left value from scala Either?
- Getting the maximum key value pair in a Scala map by value
- Object is not a value error in scala
- Why this scala code reports compilation error: recursive value x needs type
- Spark, add new Column with the same value in Scala
- How to get min by value only in Scala Map
- scala slick query return value
- Does Scala have any collections that sort by value instead of key?
More Query from same tag
- Actor-based webservice - How to do it properly?
- assign None to option when element is empty
- construct case class from collection of parameters
- Why is this throwing stack overflow exception?
- Play Framework - how do I redirect to a page generated by a plugin controller? [SecureSocial]
- Scala pattern matching with combinations over parameter list
- Why does Play refuse form reporting "Cannot resolve method apply with such signature: Missing arguments"?
- Working with two assets directories in Scala Play framework 2.4
- Running application with sbt and Akka Microkernel
- Misunderstanding of scala 'match' compile rules
- Scala 3 Tasty Reflection Macro: CyclicReference
- How to "contramap" akka-streams Sink
- Implicit conversion classes for type-aliased Function types fail to compile in Scala
- How resolve exceptions in Scala with IntelliJ?
- Scala implicit conversions and mkNumericOps with value classes
- scala: implement a generic recursive max function
- Scala Playframework - How to Modify Json and remove element form JsArray (Seq[JsObject]) based on attribute value
- Spark scala coding standards
- Iteratively capture regex subgroups in Scala
- Return function in Scala
- Need efficient way to sort list of strings (dates) in Scala. (Avoiding the darkness of Java.)
- Replace elements in one array from elements in other array in Scala
- ERROR SparkContext: Error initializing SparkContext
- Better way to parse string to associative array in Scala?
- Copy file to hadoop hdfs using scala?
- Couldn't understand why Java and Scala lower bounds behave different
- java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0 in play framework project
- how to create list consecutive values of positive or negative in scala
- functional scala: can't compile
- How to convert Complex JSON string in to MAP in scala