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
Similar Messages
-
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.RHi 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 -
Hi,
I want to maintain session expire time in portal for my iViews both Porta components and Web Dynpro. Where can I set this value.
Please let me know
Thanks
Bobby MHi,
I'm sorry. Messed it up Go through Web Dynpro application needs to never expire..
Regards,
Satyajit.
Message was edited by:
Satyajit Chakraborty -
Cisco ace Load balancer not maintaining session persistence
Hi All,
We have observed from the IIS logs on the internal webservers that loadbalancer is not maintaining session persistence for two specific request for the internal servers.
https://123.xyz.com/Webresource.axd
https://123.xyz.com/ScriptResource.axd
Error
Webresource.axd : 500
Scriptresource.axd: 404
Session persistence is maintained for all other requests hitting loadbalancer.
Issue is observerd on hits for these two specified components. WebResource.axd and ScriptResource.axd are Http Handlers used by ASP.NET and Ajax to add client-side scripting to the outgoing web page.
For e.g /WebResource.axd d=t2GXfySdqWmJ-lZSI0KVbw2&t=634868473645172160 is valid for server 1 and return 200 response but the same request is seen on few other servers where the response is 404 even though load balancer cookie is same. This means that if the request for the both the axd contains a valid decrypter and it connects to the right server then the response seen is 200.
The url passed by the user contains d and t parameters when are unique for each user session.
Solution tried:
Accessed website via another VIP without http redirect rule but could not see difference.
Tried to match machine key across all servers : Failed . Could see the ‘d’ value different for each server.
Load balancer VIP :
x.x.x.x
redirect: http > https
SSL Offload : ON
Poool:
WEB1
WEB2
WEB3
WEB4
WEB5
All servers listening on port 80
sticky config:
sticky ihttp-cookie cookie1 vip-1.1.1.1-80-stickyfarm
cookie insert browser-expire
replicate sticky
serverfarm vip-1.1.1.1_80
sticky http-cookie cookie1 vip-farm:1.1.1.1:443
cookie insert browser-expire
replicate sticky
serverfarm farm:1.1.1.1:443
Has anyone else come across similar issue?
Can you plese check if there is any config on cisco ace that will ensure that session persistence is maintained for these 2 requests.
Thank you for all the help.
regards,
SangramHello Sangram,
We would need simultanous packet traces before and after the ACE to get to the root cause of this issue so I would recommend that you open a cisco tac case for more in depth troubleshooing of this issue.
Joel Lamousnery
CCIE R&S - 36768
Engineer, Customer Support
Technical Services -
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 -
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. -
Hello,
Does anyone know how to maintain session and application variables through server restarts? I want to be able to shutdown and startup my Tomcat server without having the users lose their session and application variables (and consequently, their data and login state).
Any ideas?
Thanks!
-DavidI dont think its possbile since stopping and restarting gets new sessions. Only way that I would know would be to use cookies.
But then again i dont like the idea of saving passwords in cookies -
Hi,
I am having trouble in maintaining session in jsp frames. -
Here is sample code
parent.jsp
<HTML>
<HEAD>
<LINK rel=stylesheet type="text/css" href="defaults.css">
<TITLE>abc</TITLE>
<%
String checkAmount = "100.00";
session.setAttribute("checkAmount", checkAmount);
System.out.println("checkAmount in ppmain"+session.getAttribute("checkAmount"));
%>
<FRAMESET rows="235,*" frameborder="no" >
<FRAME NAME="pptop" SRC="top.jsp" frameborder=0 scrolling=no noresize >
<FRAME NAME="ppbottom" SRC="bottom.jsp" frameborder=0 scrolling=no marginwidth=0 marginheight=0 noresize>
</FRAMESET>
</HTML>
top.jsp -
<HTML>
<HEAD>
<LINK rel=stylesheet type="text/css" href="defaults.css">
<TITLE>top</TITLE>
<%
System.out.println("session in top "+session);
System.out.println("checkAmount in top "+session.getAttribute("checkAmount"));
%>
</HTML>
It is not able to retain session in the top.jsp ( in SOP for session I get different session ID in parent.jsp and top.jsp
This Works well in local but when gets deployed to WAS6 server troubles starts.
Any help is appreciated.
ThanksWhen you create URLs, you might want to try using JSTL to rewrite them:
<FRAME NAME="pptop"
SRC="<c:url value='top.jsp'/>"
frameborder=0
scrolling=no
noresize >
<FRAME NAME="ppbottom"
SRC="<c:url value='bottom.jsp'/>"
frameborder=0
scrolling=no
marginwidth=0
marginheight=0
noresize>Or you can use:
SRC='<%= response.encodeURL("top.jsp") %>' -
Maintain session in Multiple soap calls
Hi Experts,
We have an requirement which runs 2 synchronous calls.
1st synchronous cal is for validating user credentials and
2nd synchronous call (for successful log in) for uploading data in R/3 system.
The main task is to maintain session(ex: time 15 mins) .
1st synchronous call looks like Mobile Application (soap sender)<--->PI<----->(Soap receiver)Active Directory.
2nd synchronous call looks like Mobile Application (Soap sender)<--->PI<----->(Proxy)R/3 system.
can you pls let me know how can I achieve this requirement and
how to maintain session ID, session (is it in PI or in third party) and from where to maintain session.
Thanks in Adv..I am calling multiple web service apis from my bpel process on the same link. The Web services are written such that I always have to call a "login" api first which creates a context that's maintained throughout the session. Thus subsequent ws calls have to be made in the same session because all the other web service apis require the context to be present.
You can think of this as a stateful SessionBean (sort of).
The question is does bpel support this? -
Maintaining Sessions through Multiple Servlets and Contexts
Hi,
I have a webapplication that works like this:
* User connects to a login servlet on HTTPS
* Users information is authenticated on HTTPS
* An object is stored in the session for other servlets to validate the users access
* Authenticated users are forwarded to an HTTP page where the session is used to make sure they were granted access
My problem is this....Since I create the session in an HTTPS context, when I am in the HTTP context, I am unable to access the session and constantly get NULL. Is there any way that I can access the session from an HTTP context?What you can do is, just login using HTTPS and switch over to HTTP
and then store data in session.That is true, but what I want in the session is basically a flag on whether or not the user was granted access. I would much rather set all that up on the secure line, and then just access it from the unsecure ones...
For example, you are creating session using the
http://testdev:port/index.jsp page.
If access the same page(with hostname)
http://10.300.20.18:8080/index.jsp, you can't get the session even
though both are same web server and same web application. Because the
browser treats it different sessionI think if you use my above solution with the explicit passing of the jsessionid, you can move from one domain to another and still maintain session. Not positive on that though... -
I have a client side java program running. It is to comunicate with a web server using HTTP. How do I maintain session in my java program in the client machine. I have no access to the web server.
java.net.URL and java.net.HttpURLConnection are not maintaining session, tough allow me to transact. It creates a new session for every hit.
help!!!
Trijoy
[email protected]Hello Darted,
I have a small task ahead. My boss hates logging in userid and passwords every time he logs ont a site, which he dose 10-15 times a day. Due to session timeouts, he has to repeat the login process.
The requirement is that, I should have a process running, that will maintain the session throughout the day by hitting the URL every 18 mins or so..(session timeout is of 20 mins), and when he writes the URL the old session is maintained.
The process is such that it sends data over http to the server. The data is accepted only for the live and valid session. At present we are sending it through a form (post). If the state can be maintained in the java applet, swing or whatever, we will remove the HTML form and will automate the process of form sending.
I am looking for a mechanism which emulates a browser, i.e. maintain the session till it gets time out or browser is closed.... only I want to avoid using a browser and refreshing it every time and want to implement it thru java so that I can have control over it.
Thanks
Trijoy
PS. Any help in design, source code, suggestion is highly appreciated -
Maintaining session info on the CSS
I know by default the CSS cannot do this but what if I want it to. I have an IM application that a person has requested be put behind the CSS. They want it to be able to maintain sessions during a failover event. Any way to do this with the CSS?
You could talk to your Cisco office and see if they would consider it for a future release. If theres enough demand, you may get it through. What messaging software are you using?
-
How to maintain Session between two ear files?
HI Guys
I have deployed two ear files in oc4j. One is used to open applet and other for business operations.
My problem is after calling applet my session gets invalidate. How to save session between two context
I am new in this field please help!!
the sooner the better
RahulCan I do this if I integrate oc4j with apache!!
Can I maintain session
Plz. Help
Rahul -
Problems with maintaining session state using mod_ose
I am using 9i AS(version 1.0.2.0) and oracle 8i(version 815).
Because i need to maintain client sessions for my application, I
have activated mod_ose(for stateful session). As suggested in
the oracle documentation, i created a package containing
variables for which state needs to be maintain per client. The
state is maintained by the app server but it is not maintained
properly. All the new clients that connect to the app server
share the same session variable values. If I change a package
variable value from one client, other clients take the same
value.
Any solution?
Suggestions are most welcome.
Thanks in advance.We installed oracle9i AS on solaris, configured OSE and the
problem is not occuring now. Not sure whether its solaris that
worked or 9i AS had some problem on NT machine earlier.
Regards,
Sharad -
Oracle Database : 10g EE Release 10.2.0.1.0
Webserver : Weblogic
Application Language : Java
Problem : When i connect to Java application it creates following sessions
in Oracle server
SADDR SID SERIAL# USERNA MACHINE PROGRAM
687CAE3C 9 36980 MYUSER WEBSERVER ADDRESS java.exe
687D4EAC 26 26646 MYUSER WEBSERVER ADDRESS java.exe
687ED19C 67 15721 MYUSER WEBSERVER ADDRESS java.exe
68058310 179 14442 MYUSER WEBSERVER ADDRESS java.exeafterwards when i logout from my java application then it doesn't delete
the session. these all remain in the v$session.
And when i am tring to kill the session by following commands.
SQL> alter system kill session '9, 36980';
System altered.
SQL> alter system kill session '26, 26646';
System altered.
SQL> alter system kill session '67, 15721';
System altered.
SQL> alter system kill session '179, 14442';
System altered.But when i again query the v$session view it shows me all the session but the
status is killed..
But i cann't drop that user by runing following query
SQL> drop user myuser cascade;
drop user myuser cascade
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected.
Is any thing wrong in my process ?
Any suggestions
Regards
SinghThe vast majority of the time, when you're using a J2EE app server like Weblogic, the application server is going to maintain a connection pool. When the application server starts up, it creates a number of physical database connections. When your Java code opens and closes a connection, it's really just getting a connection from the pool and returning it to the pool. From Oracle's standpoint, nothing happens when you logically open a connection in this way, which is generally good because opening and closing physical connections is relatively expensive.
So in summary
- The number of sessions in V$SESSION probably has everything to do with the size of the connection pool you've configured in Weblogic and nothing to do with how many logical connections your application is using at any point in time.
- Do not kill sessions that are part of a connection pool. Oracle will keep the connection around until the client (in this case Weblogic) tries to re-use it, at which point Oracle will inform the client that the connection has been killed, and Weblogic will report the error to whatever application was requesting the connection.
- If you shut down Weblogic, the physical connections should go away.
Justin
Maybe you are looking for
-
ECM project, what to do with MSS? Please guide me what to do?
Hello Everyone, I have set myself a goal to learn and implement ECM at my company by myself. I have started reading very informative documents posted on my old friend/colleague u201CKevin Nguyen-Tu u201Cwebsite. Kev, you are doi
-
Error in Comunication Channel Monitoring
Hi Friends! I am triyng to connect a DB2 AS400 to PI 7.1 by JDBC Adapter, in the Comunication Channel Configuration is: JDBC Driver -> com.ibm.as400.access.AS400JDBCDriver Connection -> jdbc:as400://<Host>:<Port>/BDName User -> XXX Pas -> XXX Now
-
Hi I have created a style sheet and linked it to a template to form the basis of a website. I have included a background image in the masthead. It works fine in Firefox, but when I review the template or any pages made from the template in Internet E
-
Error: The sap bw system must not be operated in client 000
Hi I login as a client "200" and create new user "imran" and then login as a client 200 and user imran successfully but when I goto T.code RSOR it shows "the sap bw system must not be operated in client 000" when I check the status it shows client 20
-
I don't care if you think i did something stupid just help me.
So here is what happened. A while ago i accidentaley left my ipod out in a full downpour. It survived but it started doing weird things like when i tried to watch a video it would enter the video thing and for a few seconds the screen would go black.