lua-resty-openidc icon indicating copy to clipboard operation
lua-resty-openidc copied to clipboard

session.present vs session == nil

Open MahdiSahebZamani opened this issue 9 months ago • 4 comments

Hi. While working with lua-resty-openidc, I encountered the "request to the redirect_uri path but there's no session state found" error. I added some logs to the source code and realized that the session.present in the line returns false. Then, I added the session variable in the logs and found that it is present. How is it possible? I tried to comment out that if block and after that it reached this line and then returned false. The question is what is the difference between session.present and session == nil that is in this line?

Environment
  • lua-resty-openidc version (e.g. 1.7.5)
  • OpenID Connect provider (custom OP)
Expected behaviour

session.present returns true when session is not null.

Actual behaviour

session.present returns false even if session == nil was false above.

MahdiSahebZamani avatar May 14 '24 12:05 MahdiSahebZamani