This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Macromedia Flash > November 2003 > Flash/PHP Session Caching Problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Flash/PHP Session Caching Problem
ghstwrtr webforumsuser@macromedia.com

2003-11-30, 12:41 pm

Hello everyone,

I have a Flash movie where the user enter username and password, when the user clicks a submit button, a PHP script validates the user, creates some session variables, and writes "Login=true". The flash movie checks the value of Login, if tru, redirects
the user to a welcome page, otherwise displays an error message.

The first time I log in is fine, but if I log in as another user during the same browser session, the values of the previous remain cached. If I refresh the page is fine (i get the values that should be there ). In PHP I could use "header("Cache-Control:
no-store, no-cache, must-revalidate");" to set the cache to expire (it solves the problem). The issue is that using just PHP ( a regular html form posting to a PHP login script, and PHP redirecting the user to either welcome page/invalid user page worked
fine without having to set the cache to expire. Is anyone aware of any caching issues using Flash and PHP?

Thank you in advance for your help,

David


urami_

2003-11-30, 12:41 pm

quote:

> The first time I log in is fine, but if I log in as another user during the same browser session, the values of the previous remain cached. If I refresh the page is fine (i get the values that should be there ). In PHP I could use "header("Cache-Control


: no-store, no-cache, must-revalidate");" to set the cache to expire (it solves the problem). The issue is that using just PHP ( a regular html form posting to a PHP login script, and PHP redirecting the user to either welcome page/invalid user page worke
d fine without having to set the cache to expire. Is anyone aware of any caching issues using Flash and PHP?

In order to get these variable you must be loading them , assuming using the
loadVariables action.

For all cache related issues is one way out .
You won't stop it from caching , but you can force it load new data of the server
each time you request it .
Throw some random junk with the URL stuff that is usually ignore,
but the browser will see it as a unique request and hence ignore the cache.

for instance in loading variables it would be :

loadVariables("url.txt?nocache="+random(65000), 0);





Regards

urami_*



<lsym>

There's no place like 127.0.0.1

</lsym>
Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews