Click here to Skip to main content
16,017,238 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am trying to implement OAuth in my application.
On login page, I am setting a session varible with some string value.
C#
Session["CompanyInfo"] = "Your Company Name";

I then redirect to the ADFS login page where I enter correct user name and password.
After successful authentication, it redirects me to another page in my application where I am trying to access the session variable I stored earlier.

But here, I am getting session value null.
C#
string comapny = Convert.ToString(Session["CompanyInfo"]);
//Session value is null here

Any suggestions on this appreciated.

Thanks.

What I have tried:

I tried passing querystring parameter while redirecting to ADFS. Then after ADFS login, back on another page in application, tried to get that value using UrlReferer.
This worked on my local machine but not on production.
UrlReferer was blank on production server.
Posted
Updated 10-Feb-20 1:47am
Comments
F-ES Sitecore 23-Feb-17 11:29am    
Does the entire process happen in the same browser tab? Or is the login spawned in a new tab or the return in a new tab? Also do you return back to the exact same site, not changing http for https, not changing a domain to a sub-domain and so on?
Lokesh Zende 24-Feb-17 0:50am    
Yes, the entire process happens in the same domain, in the same browser tab.
Its kind of weird, I get the session values sometimes but not always.
Member 14740308 11-Feb-20 2:59am    
Hello Lokesh,

Did you find any solution for this issue?

Please let me know

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900