HTTP Session in Flex 2

Hi,
I want to know how to work with the HTTP Session object in
Flex 2?
Piece of code is really appreciable.
Thanks,
-Sameer

Check out the example from the docs:
http://livedocs.macromedia.com/flex/2/langref/mx/rpc/http/mxml/HTTPService.html#includeExa mplesSummary
That should get you started...

Similar Messages

  • [svn:bz-trunk] 21394: bug fix for watson 2887837 Not getting duplicate session detected error when same flex client id is used from two different HTTP sessions in CRX .

    Revision: 21394
    Revision: 21394
    Author:   [email protected]
    Date:     2011-06-16 12:34:13 -0700 (Thu, 16 Jun 2011)
    Log Message:
    bug fix for watson 2887837 Not getting duplicate session detected error when same flex client id is used from two different HTTP sessions in CRX.
    get the sessions id before we invalidate the duplicate session.
    Checkintests pass
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/endpoints/BaseHTTPEndpoint.java

    For our profect I think this issue was caused as follows:
    Believing that remoting was full asynchronous we fired a 2 or 3 remote calls to the server at the same time ( within the same function ) - usually when the users goes to a new section of the app.
    This seemed to trigger the duplicate http session error since according to http://blogs.adobe.com/lin/2011/05/duplication-session-error.html  two remote calls arriving before a session is created will cause 2 sessions to be created.
    Our current solution ( too early to say it works ) is to daisy chain the multiple calls together .
    Also there seemed to be an issue where mobile apps that never quit ( thanks Apple! )  caused the error when activated after a few hours.
    I guess the session expires on the server and the error above occurs on activation.
    So the mobile apps now ping the server with a remote call when activated after sleeping for more than one hour.
    All duplicate http errors are silently caught and reported.
    Fingers crossed we won't get any more!

  • Session in Flex

    You can Use the following class as a session in flex..
    [Bindable]
    private var session:Session = Session.getInstance();
    How to insert data to session
    session.setAttribute('username','sanka')
    How to retrive data from session
    var userName:String=session.getAttribute('username');
    http://dl.dropbox.com/u/7375335/Session.as
    package model
        import flash.utils.Dictionary;
        [Bindable]
         * @author Sanka Senavirathna
         *<p>
         *    Conforms to Singleton Design Pattern.
         *     </p>
         *    <p>
         *        Session.getInstance().getAttribute(key)
         *        Session.getInstance().setAttribute(key,value)
         * Code example for client
         [Bindable]
         private var session:Session = Session.getInstance();
         session.getAttribute('name')
         *    </p>
        public class Session
            private static var instance:Session = new Session();
            private var dic:Dictionary=new Dictionary(); // keep user session
            public function Session()
                if (instance != null) { throw new Error('Cannot create a new instance.  Must use Session.getInstance().') }
             * This Session is a Dictionary that keep key value pairs.Key can be object and value can be object.
             * [Bindable]
             * private var session:Session = Session.getInstance();
             * @langversion ActionScript 3.0
             * @playerversion Flash 8
             * @see getAttribute
             * @see setAttribute
             * @author Sanka Senavirathna
            public static function getInstance():Session
                return instance;
             * [Bindable]
             * private var session:Session = Session.getInstance();
             * Session.getInstance().setAttribute(key,value)
             * <p>example
             * session.setAttribute('username','sanka')
             *</p>
             * @langversion ActionScript 3.0
             * @playerversion Flash 8
             * @param key Describe key here.
             * @param value Describe value here.
             * @see getAttribute
             * @author Sanka Senavirathna
            public function setAttribute(key:*,value:*):void
                dic[key]=value;
             * [Bindable]
             * private var session:Session = Session.getInstance();
             * Session.getInstance().getAttribute(key)
             * <p>example
             * var userName:String=Session.getInstance().getAttribute('username');
             *</p>
             * @langversion ActionScript 3.0
             * @playerversion Flash 8
             * @param param1 Describe key here.
             * @see setAttribute
             * @author Sanka Senavirathna
            public function getAttribute(key:*):*
                return dic[key];

    I think This will help you to keep your shaired data in single place.this will optimize your program by
    reducing database hits,
    reducing Server hits
    Onece you retrive the data then put it into session (flex) and retrive it when you need..For example username in system.when user logged successfully
    put the user object in to session and hide the login component.then pop-up your other component.But you can access the user data from session by using
    var user:User=Session.getInstance().getAttribute('user'); something like that.
    Hope this will help you.
    enjoy
    happy cording

  • Regarding maintaining session in flex

    Hello,
              I am developing a flex application which is using jsp for database connectivity. I am using HTTP request for connecting to jsp page and passing and retrieving parameters. Now I wanted to ask how can I maintain session in flex so that I can know which client has logged into the system and on the basis of that can assign privileges to the client. Is it possible in flex and how?Reply needed urgently.
    Thanks in advance.

    Hi a.bhavika,
    There is not specifically any session management in Flex as it runs everything on the client side if at all you want to mainatain you can maintain it on the server side. ...and I think for your case I dont think you need any session managemenet as at the time of login only you can identify which user has logged in to the syetem and based on the user logged in you can load all the previleges of that particular user in the Flex application.
    Check out the links below for your understanding...
    http://www.forta.com/blog/index.cfm/2006/9/24/flex-and-session-state-management
    http://www.assembla.com/wiki/show/romoz/Session_Management_in_Flex
    Thanks,
    Bhasker

  • How to close a HTTP session when a user closes the window

    Hi,
    I am having problems when closing the browser of a BW web report. After I closed the browser by going File->close, I ran SM04 and found out the Plugin HTTP session hangs at the server side.
    How can we terminate the Plugin HTTP session at the server side when user closes the internet browser?
    I did implement a logoff function at my web template and this was implimented on the Menu page, if user clicks on the logoff, the Plugin HTTP session is terminated at server side correctly.
    If user navigates to the other pages from the main page... then the logoff function was not implimented in the other pages. So many of the users are closing the windows directly. Eevn if we impliment logoff in all the subpages, As you know, 50% of time user will close the report by closing the internet browser instead of clicking the logoff. That leaves lots of hanging Plugin HTTP sessions at our server side.
    Regards,
    Tony

    Hi,
    And also take a look on the Genral property of the web template. We solved this problem by changing only this property (no extra things).
    <b>Property:                            Value</b>
    Automatic Session Management:           Active
    With rgds,
    Anil Kumar Sharma .P
    Message was edited by: Anil Kumar Sharma

  • Bw web report plugin http session hangs at the server side

    Hi,
    I am having problems when closing the browser of a BW web report. After I closed the browser by going File->close, I ran SM04 and found out the Plugin HTTP session hangs at the server side.
    How can we terminate the Plugin HTTP session at the server side when user closes the internet browser?
    I did implement a logoff function at my web template, if user clicks on the logoff, the Plugin HTTP session is terminated at server side correctly. But As you know, 50% of time user will close the report by closing the internet browser instead of clicking the logoff. That leaves lots of hanging Plugin HTTP sessions at our server side.
    By the way, we actived our BEX service at the SICF.
    Thanks for help!
    JA

    Hi
    If you want to avoid a blank page with logoff button, add opener=0
    <a href="<SAP_BW_URL CMD='LOG_OFF' ~command='logoff'
    >" onClick="javascript:window.close(opener=0);">Log off</a>
    If you want to close the session via X, use this code:
    create a sapscript function
    function closeSession()
    logoff()
    window.unload=CloseSession()
    However, the Plugin HTTP session isn't killed.
    Regards

  • In-memory replication of http session is not working in BEA7 cluster

              Hi everyone,
              I have 3 managed servers in Bea7.0 SP4 in a cluster. The client requests are sent
              through apache web server. I have given cluster address as URL in httpd.conf of
              apache server which sends the client requests for dynamic pages such as JSPs and
              servlets to the weblogic cluster.
              Load balancing is working fine. I ensured this from the log files of all the 3
              servers. All the 3 servers are getting different client requests and thus load
              balancing is working.
              Now, I wanted to achieve Fail-over. I do not think that i should use proxy plug-in
              for this. I feel the cluster itself will handle fail-over provided i make the
              http session as memory replicated.
              I updated the weblogic.xml with the following entry :
              <session-descriptor>
              <param-name>PersistentStoreType</param-name>
              <param-value>replicated</param-value>
              </session-param>
              </session-descriptor>
              I guess this is sufficient to make the http session as cluster aware.
              But when I shutdown server1, the user connected to server1 will be kicked out
              of the session and come to login page through server2 or server3 which are running
              fine.
              Could anyone help me to achieve http session as cluster aware. Does it indicate
              that I have to go for WLS proxy – HttpClusterServlet to achieve fail over for
              http session ?
              BTW, for your info, i am using setAttribute() and getAttribute() while manipulating
              the session.
              thanks in advance.
              

              Hi Ryan,
              Thanks for ur valuable input.
              I can see failover working.
              But, I can not continue with the same session in my application.
              I printed session Ids before and after failover, I found both are different.
              I guess session replication is a responsibility of weblogic/apache plugin.
              If not please let me know which all settings I should do to make failover working?
              Thanks again.
              Plad
              "ryan upton" <ryanjupton at learningvoyage dot com> wrote:
              >Plad,
              >
              >Are you trying to gracefully shut down the server? If you are then the
              >problem that you say you can't identify is simply the server's default
              >behavior which is to wait for all non-replicated sessions to be dropped
              >or
              >timed out before killing the process. Try forcing the shutdown: kill
              >-9 the
              >PID or CTRL-C if you started the server from the command line. You can
              >also
              >check the ``Ignore Sessions During Shutdown" checkbox under the server's
              >control tab in the admin console, this should allow you to shut down
              >gracefully without waiting for session timeout. BTW your sequence is
              >off
              >in #5 below, the replication doesn't occur upon failure, the replication
              >has
              >already happened once you created the session object on the first server,
              >I
              >think maybe you're confusing replication with failover.
              >
              >~RU
              >
              >"Plad" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> Hi,
              >> I have 2 managed servers in a cluster.
              >>
              >> 1. I have got a DNS name configured which maps to these 2 managed server's
              >IP
              >> addresses.
              >> 2. I can browse my site using this DNS name.
              >> In HTTPD.conf I have :
              >>
              >> ServerName dev.a.b.net
              >>
              >> <IfModule mod_weblogic.c>
              >> WebLogicCluster 10.1.38.232:7023,10.1.34.51:7023
              >> MatchExpression *.*
              >> </IfModule>
              >>
              >> LoadModule weblogic_module modules/mod_wl_20.so
              >>
              >> 3. I have adeded session descriptor in weblogic.xml , also enabled
              >proxy
              >plugin
              >> in weblogic console.
              >>
              >> 4. I tested accessing my application using DNS url after shutting down
              >alternatively
              >> each manaed server. I can access application.
              >>
              >> 5. Now, problem comes when I access a managed server1 , keeping server2
              >down.
              >> I am able to access my application.
              >> Now, I start the server2.
              >> (Here I am supposing that replication should occur)
              >> Then I am shutting down server1.
              >> But, this time the server log shows me following:
              >>
              >>
              >> 9:58:51 AM GMT+05:30 NOTICE Web application(s) chlist still have
              >non-replicated
              >> sessions after 2 minutes of initiating SUSPEND. Waiting for non-replicated
              >sessions
              >> to finish.
              >> 10:00:51 AM GMT+05:30 NOTICE Web application(s) chlist still have
              >non-replicated
              >> sessions after 4 minutes of initiating SUSPEND. Waiting for non-replicated
              >sessions
              >> to finish.
              >>
              >> I am unable to make out where the problem is?
              >> Can it be a problem of Liecense? Is there any specialcluster liecense
              >for
              >weblogic8?
              >>
              >> Hoping to get replies.
              >> Thanx.
              >> Plad
              >>
              >> "ryan upton" <ryanjupton at learningvoyage dot com> wrote:
              >> >See my reply to your first post, but I've also added a few comments
              >here.
              >> >
              >> >"jyothi" <[email protected]> wrote in message
              >> >news:[email protected]...
              >> >>
              >> >> I guess someone from bea support team only can answer both your
              >question
              >> >and mine.
              >> >> As per my knowledge, we do not need to do any setup at Apache
              >side
              >> >regarding
              >> >> cluster other than mentioning cluster address as URL while
              >contacting
              >> >WLS
              >> >> from apache.
              >> >>
              >> >> I hope someone from Bea, will help us. I do not think that we
              >> >go for
              >> >WLS
              >> >> proxy plug-in using HttpClusterServlet for making session replication.
              >> > I
              >> >strongly
              >> >> feel that the cluster itself be able to manage the fail-over of
              >> >http
              >> >sessions
              >> >> provided we put the entry "PersistentStoreType" in weblogic.xml
              >> >regarding
              >> >> the session replication.
              >> >>
              >> >
              >> >The cluster does handle the management of Sessions. The clustered
              >> >applications still create the Session objects and the cluster manages
              >> >them
              >> >as per your deployment descriptor settings (replicated, JDBC, File)
              >however
              >> >the proxy has to be aware of which server the client has an affinity
              >> >for
              >> >(only with replicated sessions) and it does that by reading a cookie
              >> >passed
              >> >back from the server that handled the initial request and created
              >the
              >> >primary session object. The proxy has a list of both the primary
              >and
              >> >secondary server locations from this cookie that it can use to failover
              >> >the
              >> >request if the primary server fails. Clusters _DO NOT_ failover nor
              >> >do they
              >> >load balance, that's the job of your proxy, whether you're using the
              >> >HTTPClusterServlet, WLS Plug-in or a more sophisticated hardware load
              >> >balancer like Big IPs F5
              >> >
              >> >> jyothi
              >> >>
              >> >
              >> >~RU
              >> >
              >> >
              >>
              >
              >
              

  • How to find the list of users loggin through HTTP session

    Hi All,
    we are using SRM 5.5 system with ITS. I am able to find the list of concurrent users from ABAP level using report "CCUEVAL" but how do I know the list of concurrent users logged in from HTTP session?.
    could you please let us know the SAP note number or any report?
    Thanks in advance,
    Mohan Karri

    Hi Uday,
    thank you very much for your prompt response.
    I need a report because by end of every month I would need the average peak http users list for the reporting month.
    or tell me how to find " how many users logged in through HTTP session in a day?"
    Thanks
    Mohan

  • How to get HTTP session in Applcation Module IMPL file

    Hi Guys,
    Can any one tell me how to get HTTP session in Applcation Module IMPL file ?
    thnks

    You can, but that's not a best practice.
    Re: How to reach HttpContext from model Project

  • Define HTTP Session Attribute in a Custom Authenticator

    Hello everyone I developed sucessefully a Custom Authenticator for WLS10 that interacts with a web service.
    But now I need to provide an object to the web applications with the some user information.
    I was wondering defining the object in the HTTP Session but I dont know how to do it via de LoginModule of the custom authenticator.
    Can anyone provide me some tips?
    thanks in advance.

    What kind of user information do you need to pass on to the webapplication ? username can be retrieved by request.getRemoteUser() (after successful login).
    May be you need to clarify little bit more on what you want to achieve.
    -Utpal

  • Regarding session in flex

    hi,
    My question is ,how i have set session in php and in flex. i could not know how to set session in flex and php.How to handle session in flex.
    Please provide me solution to solve the problem.
    Thanks and Regards,
    venkat.R

    Hi Venkat,
    You have to save PHPSESSID. for each request you made to server send this as URLVariable.
    I think this should work.
    let me know If it is helpfull.....
    Thanks,
    Vikram

  • Dynamic reloading in iWS 6.0 causes my http session to be lost

    Hi,
    I have a problem with dynamic reloading in iWS 6.0 Sp2 on Solaris 8. I have not set the reload-interval for the class-loader, in fact i haven't included anything related to the classloader in the web-apps.xml file.
    The default behaviour is observed, the classes are reloaded every 30 seconds. So far, so good.
    I have seen that if a change a class, iWS reloads the entire application, destroying all the servlets in it. This destroys my HTTP session.
    The same behaviour is observed in a redeployment, and in a reloading of config files.
    Is there any way of avoiding this?
    Thanks.
    By the way, could anyone describe the classloader architecture of iWS.
    Juan

    Scott,
    Does the problem only occur on MSIE clients? Do this work properly on Communicator? If so, you may be running into a problem with how MSIE determines the maxage for a cookie.
    The criteria that IE uses for creating a new session is the length of time that a session has been alive. For this reason, when a user tries to connect to a web application on the iWS webserver through IE, the time on the client server and on the webserver must be set correctly. Otherwise, the user could experience problems with session data getting lost or discarded by the client.
    This problem does not occur on Netscape browsers, as Netscape browsers set the cookie using the client-side clock and the maxage sent by the server.
    Refer to this technote and see if the helps:
    http://knowledgebase.iplanet.com/ikb/kb/articles/4704.html

  • Sessions in Flex

    Can anyone tell me how sessions work in Flex? From a browser perspective, I understand when a new session is created the ID is saved into a session cookie client-side and this ID is used to link the browser to the server-side session. But I can't find any cookies that relate to my Flex application (assuming it uses cookies).

    Session informatione is, basically, every variable you create and store in the Flex application.
    Sessions cookies are a work around for the stateless nature of HTML Pages.  Every HTML page exists in isolation andk nows nothing about any other HTML page or the history of the user viewing that page.  The server sets a cookie to match the request up a request with a server side session.
    In Flex, there is only one page request, so no need for cookies to keep track of sessions.  The complete app exists 'once' for each user; as opposed to the server side code which is shared across all users.
    That said, if you need sessions for your server side code; remote requests from Flex will include the cookie information set by the server; which will allow said requests to match your remote call to a server side session.
    Flex does not have access to read browser cookies, although it may be possible to do so using ExternalInterface and JavaScript.

  • Https session lifetime

    How can lifetime of a secure session be controlled in OC4J 9.0.3-9.0.4?
    Is "session-timeout" parameter in web.xml valid or is the SSL session controlled by other parameters?
    We are migrating to https an application that worked properly in http mode, and sessions expire now after just a few seconds. We can't find where to config https session timeout. OC4J documentation is very vague regarding to secure applications.
    Thanks,
    Modulab Team

    Having the same problem for more than 1 week, couldn't find a solution. Session expires in a very short time in https. We're using standalone OC4J (9.0.3). Do I have to change it with AS now ? Isn't there any other solution, patch or something like that ?
    Any kind of your help would be greatly appreciated since thousands of WEB users of our institution CAN NOT use all of our https WEB apps.
    Regards,

  • Model session not in sync with Http Session

    Hi All,
    I have an application developed in JDev 11.1.1.4 and we are not using ADF Security for login.
    The problem occurring is randomly some of the LOV on my home page are getting null (having no data). These LOVs are populated using the values passed as bind parameter from the login values (basically HTTP session values at web layer). So i added a method in all the task flow to set the session value at the model layer (default method) . Also on each call to the Am Impl call i am setting the value in the HTTP session and then invoking the method, but some how what happens is the Model level session value is not in sync with HTTP session and the list gets empty.
    Any inputs what i can do to get out of this prblm ?
    thnk

    In this case you need to overwrite the activateState/passivateState method of your am and store/reads the values from the xml structure you get as parameters to this methods.
    For more detailed information check the docs http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcstatemgmt.htm#sm0495
    By the way, this is nothing you need to open an SR on as it's working as designed.
    Timo

Maybe you are looking for

  • Install hp 4500 g510 on windows 8.1

    Hi, I have tryied everything for installing hp 4500 g510 and nothing works, it says fatal error once starts confuguring the product everytime I try to install after unistalling completelly, last time it failed the installation hp downloded a set of s

  • My i pod won't scroll up or down.

    My Ipod touch won't scroll up or down and the display is a negative view. What can I do?

  • Nothing displayed on TV through HDMI.

    I have an Acer 4820T with Intel HD 3000 graphics and am trying to use a Sharp LC-37GA8E as a second display. It works in Windows 7 without problems but not in Arch using arandr/xrandr. The TV will change resolution as you try different settings but t

  • CS6 trial installation stops at the initial login screen

    Hi guys I am new to photoshop and photography both. I bought a new PC yesterday with 4K LG display. The PC has gigabythe 9600 display card with 2GB RAM on it. Intel i7 quad core cpu 4 GHz, 16 GB RAM, 250 GB SSD, 1 TB HDD 7200 RPM. REst is on the boar

  • How to Uninstall Oracle10g from Windows XP

    Hi everybody... I'm having some problems in my computer, specifically with SQL Plus, so that, I'd like to uninstall and try to install back again the Oracle 10g bundle. Does anybody know how can I uninstall Oracle 10g from Windows XP(32 bits)? Please