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

  • Home
  • SEARCH
  • 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 6658751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:57:00+00:00 2026-05-26T01:57:00+00:00

BACKGROUND: I’m using two MVC3 websites for mixed mode authentication. I’m authenticating a person

  • 0

BACKGROUND:
I’m using two MVC3 websites for mixed mode authentication. I’m authenticating a person using windows authentication in Site1, and then forwarding that person onto Site2 which uses Forms authentication. My solution was to gather user information in site1 once the user is authenticated via windows auth. I would then write this info to a cookie, and then redirect to Site 2. Site 2 would then use the info found in the cookie to automatically log in the user using Forms Auth. Both applications are in the same domain and should be able to share cookies, however the cookie isn’t available after the redirect until the page is refreshed or by clicking on a link in the site (visiting a 2nd page).

Anyway, here’s my problem. I create the cookie and then forward the user to Site2 from Site1.

...{cookie created here and added to response}...
HttpContext.Response.Redirect("http://site2.mydomain.com")

When I do this, there isn’t a cookie in the request. However, once on the home page of Site2, I can hit refresh, and then my cookie is part of the request and my authentication works.

I need my Response to write the cookie to the client, then get that cookie added in the request, but it seems to skip that when using Response.Redirect…

UPDATE:
I’ve read that the request will only have cookies included when the cookie exists before the request is made. Since I’m writing the cookie into the response for the request, only subsequent requests will contain the cookie. So, what I need is a way to force a second request, once they get my response from the initial request. So…

User sends request —> response returns with cookie —> force another request (should contain cookie) —> return requested page.

Can I do this using javascript? Can the javascript check the response for a cookie of a certain name, and when found, cause a redirect to the current page?

  • 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-26T01:57:01+00:00Added an answer on May 26, 2026 at 1:57 am

    If you have to force the refresh to get a second request, you could perhaps append a Query String parameter from Site1’s redirect HttpContext.Response.Redirect(“http://site2.mydomain.com?refresh=1”), then in Site2, cause a redirect to the same page sans query string parameter.

    That’s not really ideal though. Could you put that cookie information into a query string for a one off authentication URL that then stores a new cookie and redirects to Site2’s homepage?

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

Sidebar

Related Questions

Background: At my company we are developing a bunch applications that are using the
Background I am writing and using a very simple CGI-based (Perl) content management tool
Background: I have created sample windows application for learning to implement localization. My each
Background School Corp. has two databases with a common table, employees. These two databases
Background We currently use OpenID for authentication of users, and use the Claimed Identity
Background This is only my second PyQt4 project. Developing a Windows app that has
Background: I am using Eclipse to develop an Android app. I have an xml
Background: I'm in the process of creating a web service using ASP.NET 2.0. This
Background: One of the problems with using a local static variable in a function
BACKGROUND: Co-worker Adam has been using Google refine to process database downloads with much

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.