# Store val in session

**URL:** <https://community.gatling.io/t/store-val-in-session/3621>\
**Category:** Gatling (Open-Source)\
**Created:** [March 20, 2017, 10:04pm UTC](https://community.gatling.io/t/store-val-in-session/3621 "2017-03-20T22:04:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_Breizh](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@Nicolas\_Breizh](https://community.gatling.io/u/Nicolas_Breizh)\
**Post date:** [March 20, 2017, 10:04pm UTC](https://community.gatling.io/t/store-val-in-session/3621/1 "2017-03-20T22:04:50Z")

</div>

Hi,

Strange problem when trying to store value in my session and retrieve it in exec block behind. Here a sample :

exec(

> session =\> {  
> val toto = “totototototo”  
> session.set(“cookieval”, toto)  
> }

)

exec(  
session =\> {  
println(session)  
session  
}  
)

when printing my session variable, nothing about my cookieval attribute… Anything missing ?

---

<div class="post-metadata">

**Author:** ![notdryft](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/notdryft/32/1103_2.png) [@notdryft](https://community.gatling.io/u/notdryft)\
**Post date:** [March 21, 2017, 6:52am UTC](https://community.gatling.io/t/store-val-in-session/3621/2 "2017-03-21T06:52:12Z")

</div>

Every DSL element in Gatling is a builder. Therefore, nothing happens unless everything is chained properly and given to Gatling’s setUp.

You are missing a dot before the second exec.

Cheers!
