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 3608012
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:26:55+00:00 2026-05-18T21:26:55+00:00

We have a Rails 3 app using session-based authentication (modified acts_as_authenticated), and a Flex

  • 0

We have a Rails 3 app using session-based authentication (modified acts_as_authenticated), and a Flex app that needs to be embedded in an html.erb template. The Flex app needs to access routes that have a before_filter set to check if the user is logged in. When interacting with the HTML site, this causes the user to be redirected to a login page, then sets a Rails session property (tied to a cookie) to record that the user is logged in when making future requests.

The Flex app needs to access XML that’s generated by Rails (behind the before_filter) and I don’t want to force the user to log in twice — what should I be passing as a flash parameter to the Flex app so that it can present as “already logged in” if that session exists (ie, the user has logged in via the HTML interface)? I haven’t dealt with this kind of problem before so I’m not sure if I’m even asking the right question. Any advice appreciated!

  • 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-18T21:26:56+00:00Added an answer on May 18, 2026 at 9:26 pm

    Integrating flash into your authenticated service can be tricky. You can’t rely on normal http sessions or cookies to manage authentication for you. What is generally regarded best practice is to generate a unique token for each logged in user to pass on every request to the server to prove that they are in fact a logged in user. for example:

    • They log in through an html form.
    • When you serve up a swf that is going to access authenticated content you give it a flashvar of token=49r03f0239fhduffnkdjfgnas or something like that.
    • This token is generated server-side and stored somewhere to be checked on requests.
    • On every request to the server you pass this token and check it’s validity.
    • If it’s good you perform the action and return the data.
    • If it’s bad you prompt the user.

    notes:

    • tokens should be long and unguessable like a session variable.
    • each time they log in you need to generate a new token.
    • each time they log out you need to destroy the token.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Rails app with an API endpoint that I'd like to authenticate
Some of the users of our Ruby on Rails app have complained that page
I'm using Nginx with Phusion Passenger to run a Rails app on an EC2
So here is the situation - I have a store app that I want
I have been struggling to get a simple autocomplete working with my Rails app
Let's say I have deployed my Rails app on a VPS, and everything works
I have a private method in my Rails app to connect to Amazon S3,
I have a Rails application for which I use devise to authenticate my users
In a Rails app, I am loading a partial via an ajax call. (still
I've found plenty of articles showing me what EventMachine is and how to set

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.