# Need to maintiain session with requests from Flash movie

**URL:** <https://www.ruby-forum.com/t/need-to-maintiain-session-with-requests-from-flash-movie/88537>\
**Category:** Rails\
**Created:** [March 12, 2007, 12:55pm UTC](https://www.ruby-forum.com/t/need-to-maintiain-session-with-requests-from-flash-movie/88537 "2007-03-12T12:55:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanight](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@vanight](https://www.ruby-forum.com/u/vanight)\
**Post date:** [March 12, 2007, 12:55pm UTC](https://www.ruby-forum.com/t/need-to-maintiain-session-with-requests-from-flash-movie/88537/1 "2007-03-12T12:55:19Z")

</div>

My application has a flash element in it which makes a couple of  
different requests which need to maintain the session. Since flash  
movies don’t seem to send the session cookie, I’ve had to pass in  
Rails’ session\_id and append that to the querystring of the URLs Flash  
requests.

Problem is that works for the first type of request which is a GET.  
With the POST request (which uploads a file) Rails ignores the  
session\_id I supply and I get a new session\_id.

I don’t know if the session\_id should be passed in as post data rather  
than in the querystring for POST requests but due to a limitation in  
how Flash does these uploads, the querystring is the only way I can do  
it.

One solution would be to manually get Rails to use the right  
session\_id when it finds that parameter in the URL but I don’t know if  
that’s possible.

Thanks

---

<div class="post-metadata">

**Author:** ![vanight](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@vanight](https://www.ruby-forum.com/u/vanight)\
**Post date:** [March 12, 2007, 1:04pm UTC](https://www.ruby-forum.com/t/need-to-maintiain-session-with-requests-from-flash-movie/88537/2 "2007-03-12T13:04:19Z")

</div>

On 12 Mar 2007, at 12:54, David N. wrote:

> I don’t know if the session\_id should be passed in as post data rather  
> than in the querystring for POST requests but due to a limitation in  
> how Flash does these uploads, the querystring is the only way I can do  
> it.
> 
> One solution would be to manually get Rails to use the right  
> session\_id when it finds that parameter in the URL but I don’t know if  
> that’s possible.

Use the hack described at:  
[http://blog.inquirylabs.com/2006/12/09/getting-the-\_session\_id-from-](http://blog.inquirylabs.com/2006/12/09/getting-the-_session_id-from-)  
swfupload/

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![vanight](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@vanight](https://www.ruby-forum.com/u/vanight)\
**Post date:** [March 12, 2007, 3:00pm UTC](https://www.ruby-forum.com/t/need-to-maintiain-session-with-requests-from-flash-movie/88537/3 "2007-03-12T15:00:42Z")

</div>

Many thanks Peter, that was just what I was looking for.

David
