0

I have added a new key value pair into session in controller file like below:

request.session['new_key']= new_value

And i need to access this new key in my qweb template! I tried:

  <t t-esc="website.new_key"/> and 
  <t t-esc="env.new_key"/> 

Nothing works, but it works

  <t t-esc="env.uid"/> 
  <t t-esc="website.user_id"/> 

And another doubt is, where can i add new key value a pair into session during successfully login? Please suggest any solution... Thanks

KbiR
  • 4,047
  • 6
  • 37
  • 103

1 Answers1

0

It's even simpler - you can do this:

<t t-esc="request.session.new_key" />

(maybe also request.session['new_key'] but I have not tried that).

cgs
  • 322
  • 1
  • 4
  • 15