This content has been marked as final. Show 4 replies
Refreshing the page will cause everything to be initialised. If you want the information to persist you should consider using shared objects (which are like cookies) or use some server side code. Where is the username and password currently validated ? Are you calling a webservice to make a database call to validate this data or are you doing it internally by hard coding it in your actionscript ?
I use webservice which makes database call and get info to check username and password and also generate Session in my web servis.
I call web service
<mx:WebService id="service" wsdl=""/>
However, when I refresh page, web service will be called again. Therefore my Session has gone. Is there any method to solve whether using actionscript or web service?
Thanks in advance.
Even though the browser page is refreshed, the session should still be available on the server side, so should be accessable by your webservice. Maybe you can call the webservice and check if the session exists and return the data to your Flex application.
You need to decorate your web service with the right attribute
Public Function Login(UserID as String, Password as String)
'your login logic here
This works great for me. Please note, the above is VB, it looks like you are doing C# - the syntax on the decoration might be a little different.