Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6601255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:43:45+00:00 2026-05-25T18:43:45+00:00

I’m having users login to my site using Facebook. They are sent away from

  • 0

I’m having users login to my site using Facebook. They are sent away from my site to Facebook and then redirected back after they have given the site permission. The problem I’m facing is accessing the Session variables I set before they left the site. When the user returns to the site an entirely new Session is created. The strange thing is if the user navigates the site, some pages the original session will be accessible, and sometimes the newly created session.
I’ve tried creating cookies:
Response.Cookies[“user”][“LoggedIn”] = “true”;
As long as the user hasn’t left the site I’m able to access those cookies fine, but as soon as soon as they leave and come back I don’t seem to be able to access those either. So my question is what is the best way to persist data from before before a user is sent away from the site to when then are redirected back?

AccountController:

public void Login()
{
    Session["BeforeLogin"] = "foo";
    redirect(FacebookUrl);
}

//Where Facebook redirects the user back to
public ActionResult OAuth(string code, string state)
{
    if (LoginSuccessful)
    {
        Session["LoggedIn"] = true;
    }
    return View();
}

HomeController:
    public HomeController()
{
    setLoggedInSession();
}

public void setLoggedInSession()
{
    //This is where I'm having the inconsistency
    string foo = Session["BeforeLogin"];
    ViewData["LoggedIn"] = Session["LoggedIn"];
    //It'll either be BeforeLogin is null and LoggedIn is true
    //or BeforeLogin will be "foo" and LoggedIn will be null
}

EDIT:
Some new information about this issue. Doing some testing I’ve found that the Session seems to work fine when I’m only using a single instance. When I do high availability though (running 5 instances) is when I start experiencing the issues. Most noticeably in IE. My hypothesis is that when you’re redirected back to the site from Facebook you’re getting a different instance than you left and it creates a new session before it manages retrieves the original one.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:43:46+00:00Added an answer on May 25, 2026 at 6:43 pm

    AppFabric Caching:
    “Consistent development model across both Windows Azure AppFabric and Windows Server AppFabric.
    Secured access and authorization provided by the Access Control service.”
    It’s non-resident to any one instance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
We're building an app, our first using Rails 3, and we're having to build
I am currently running into a problem where an element is coming back from
I am using Paperclip to handle profile photo uploads in my app. They upload
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.