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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:36:22+00:00 2026-06-02T02:36:22+00:00

It’s an interesting problem, really, for all you Devise masters you there. We have

  • 0

It’s an interesting problem, really, for all you Devise masters you there.

We have Devise setup with OmniAuth, but the issue happens regardless if you are logged in via Facebook, or logged in via a normal username. What happens is we have a Flash game embedded on our website. When you finish playing the game, the game will submit your score to the Rails backend:

request = new URLRequest("http://mydomain.com:2012/games/1/leaderboards/13/submitLeaderboardStatistic");
request.method = URLRequestMethod.POST; 

var loader : URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
var variables : URLVariables = new URLVariables();
variables.game_value = aScore;
variables.game_id = 1;
variables.unique_identifier = "com.onecoolgameaday.highscores";
variables.time_stamp = new Date();

request.data = variables;  

loader.addEventListener(Event.COMPLETE, on_complete);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.load(request);

The URL is sent out to our URL. The Controller (Leaderboards are nested underneath Games) gets the url information in the submitLeaderboardStatistic method. This method deals with the information. In this method, I call current_user to get the current User, the one who submitted the actual score. Problem is, current_user returns nil.

Apparently, what is happening, is once the game Launches that URL POST request, devise invalidates the session (or something), so I cannot tell who submitted the score.

Why is the current signed in user being “kicked off” once the Flash Game send the URL? How do I fix this so I can say “user XXX submitted this score.”

Thank you!

Rails: 3.2.2
Ruby: 1.9.2
Devise: 1.5.3

  • 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-06-02T02:36:24+00:00Added an answer on June 2, 2026 at 2:36 am

    Does the form you are submitting have a valid CSRF token? I think Devise calls reset_session if the csrf token is invalid or doesn’t exist.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.