Skip to content

Commit cc911d6

Browse files
committed
#4: imports in readme
1 parent a79bf7c commit cc911d6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ session data that is sent to the client, and verified when the session token is
4242
## Example
4343

4444
````scala
45+
import akka.http.scaladsl.server.Directives._
46+
47+
import com.softwaremill.session.{SessionConfig, SessionManager}
48+
import com.softwaremill.session.SessionDirectives._
49+
import com.softwaremill.session.SessionOptions._
50+
4551
val sessionConfig = SessionConfig.default("some_very_long_secret_and_random_string_some_very_long_secret_and_random_string")
4652
implicit val sessionManager = new SessionManager[Long](sessionConfig)
4753

@@ -129,6 +135,8 @@ convenient to use a `MultiValueSessionSerializer[T]` which should convert the in
129135
Here we are creating a manager where the session content will be a single `Long` number:
130136

131137
````scala
138+
import com.softwaremill.session.{SessionConfig, SessionManager}
139+
132140
val sessionConfig = SessionConfig.default("some_very_long_secret_and_random_string_some_very_long_secret_and_random_string")
133141
implicit val sessionManager = new SessionManager[Long](sessionConfig)
134142
````
@@ -137,6 +145,11 @@ The basic directives enable you to set, read and invalidate the session. To crea
137145
and set a new session cookie), you need to use the `setSession` directive:
138146

139147
````scala
148+
import akka.http.scaladsl.server.Directives._
149+
150+
import com.softwaremill.session.SessionDirectives._
151+
import com.softwaremill.session.SessionOptions._
152+
140153
path("login") {
141154
post {
142155
entity(as[String]) { body =>
@@ -265,6 +278,11 @@ These can be customized in the config.
265278
Example usage:
266279

267280
````scala
281+
import akka.http.scaladsl.server.Directives._
282+
283+
import com.softwaremill.session.CsrfDirectives._
284+
import com.softwaremill.session.CsrfOptions._
285+
268286
randomTokenCsrfProtection(checkHeader) {
269287
get("site") {
270288
// read from disk

0 commit comments

Comments
 (0)