Accessing session variable in Flex.
Hi All,
I'm using RemoteObjects for accessing data and using Spring BlazeDS. How to retrieve 'session' variable values in Flex?
Main application which is calling different .mxml files. It first invokes login(login.mxml) page with successful user credentials it will display home(home.mxml) page and I have search(search.mxml) pages.
In case user session timeouts then I'd like to send user request to login page for login.(say user is in search page and where he left for 30 minutes, after then when user clicks anything on search page, it should redisplay login page because session timeout is set to (25 minutes). How to do this Felx??
Thanks in advance.
Regards,
Sharath.
More detail solution will be found in the help.
Look for the following string in your local help (in flex builder): Communicating with the Wrapper.
You will probably find that you have to do something like the following:
a) call from flex to the wrapper page javascript function. (this would be a polling operation, run on a timer event (say) once every minute.
b) the javascript function you call conducts an Ajax call to determine the current session state.
Note that the above will likely keep your session state alive.
Another possibility is to pass in the value of your session timeout via a FlashVars variable.
Again, in a timer function run every minute, invcrement a local counter.
When local counter equals session passed in, then you might assume that the session has timed out.
IHTH.
Cheers
Similar Messages
-
Access session variable inside AM module
Is there any way to access session variable inside AM module custom function?
I created one client interface function in AM and want to access one session variable value inside AM custom function.
Please suggest.
ThanksHi
here i need help to find out right approach,my use case are below
1.User will login thorough SSO .
2.Based on used id i need to display user data in table form.
3.User-id will need to display in right corner of page template ( JSF page with this page template)
4.user can update/create new table data by pressing update/createinsert button.
5.Once user press the create new request button,one empty row will popup which have user-id filled automatically (used-id who logged in) and will read only ,so that once user commit the data,DB can update/insert the data with that user-id
so far i have done point 1,2,4 and 5 like
1.i created AM preparesession and store the use id.
2.i have putted whereclause in AM for particular VO and run execute query and able to see particular user data,who logged in.
4.created servicemethod for createinsert in AM and exposed it ,and set used-is table attribute which i got in AM preparession .Now i am able to see new row with user-id in one column in read only form when
Is this the right approach ? and now i am not able to do step 3 so how to display same user-id in pagetemplate as this value is available in AM only. -
Accessing session variables with php
I am trying to access the session variable $_SESSION['MM_Username'] in one of my php pages, but it is somehow showing empty (i.e it does not contain the username that was entered during login).
I checked and confirmed that my login.php function is properly setting the MM_Username session variable by echoing it from the login function.
So why can't I read it from another php file in the same session? Do I need to do something else before the session variables can
be properly read from any php file in the same session? Any help would be appreciated.Here is a test code I am using to access the session variable $_SESSION['MM_username'] from the php page test.php. But it is not working.
I get an empty string all the time for $username. Can any one see something wrong with this code?
<?php require_once('Connections/MyTestingConn.php'); ?>
<?php session_start(); ?>
<?php
$username = "-1";
if (isset($_SESSION['MM_username'])) {
$username = $_SESSION['MM_username'];
echo $username;
else
echo "Eror: can not access session variable";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
</head>
<body>
</body>
</html> -
Access Session variable inside Transaction
Hi All,
Is it possible to access session variables inside Transaction.
Create session variable.
Update session variable value
acccess Session variable.
(user session)
Regards,
SachinHi Sachin,
Here is the snapshot:
1. Take session variable in a local JS variable in HTML page.
2. Create a transaction with a input type variable in Transaction Properties.
3. Create a Xacute query and link the above transaction.
4. Creata a iCommand applet on HTML page and link the query template:
<PARAM NAME="QueryTemplate" VALUE=".../QueryName">
Call the function in the below way in HTML:
Applet.getQueryObject().setParam(1,vaiable)
So, the session variable will go to TRX (BLT) and perform the operations as per your need..
You can pass it to other TRX by the same way.
To fetch the value: Create output type variable in TRX 2. Create Xacute query.
Get the value with : Applet.getValue(1,1)
Hope it is useful.
Best Regards,
Kedar -
Using session variables in Flex 2
I'm not sure if this is the correct place for this
topic...but the Flex 2 upgrade/migration forum didn't seem too
lively. So let me set up my situation and then pose the question.
In Flex 1.5, I accessed the session servlet using:
<mx:RemoteObject source="servlet" id="servlet"/>
This allowed me to store session variables such as a user
object:
var u:User = new User();
servlet.session("set", "user", u);
This allowed me to access these variables from another Flex
app:
var user:User;
servlet.session("get", "user");
How would I go about doing this in Flex 2.0? Thanks to those
who can help.That almost works. I had to adjust the syntax to the following...and then there are other issues doing this.
select cust_no, name,'@{session.currentUser}' from customersMy write-back SQL is this:
UPDATE customers SET NAME='@{c1}',LAST_EDITED_BY='@{c2}' WHERE CUST_NO=@{c0}But I don't want to display the cust_no column to the user. So I hide it in the UI. But if I do that I get the below error during write-back. Apparently sometimes when you hide a column on a direct query (numeric maybe?) the value doesn't transfer over to the write-back. If that's the case, this won't work for me. Hmm...
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43093] An error occurred while processing the EXECUTE PHYSICAL statement. [nQSError: 17001] Oracle Error code: 936, message: ORA-00936: missing expression at OCI call OCIStmtExecute: UPDATE customers SET NAME='Wyatt Donnely',LAST_EDITED_BY='Administrator' WHERE CUST_NO= . [nQSError: 17011] SQL statement execution failed. (HY000)
SQL Issued: EXECUTE PHYSICAL CONNECTION POOL dev1 UPDATE customers SET NAME='Wyatt Donnely',LAST_EDITED_BY='Administrator' WHERE CUST_NO= -
Access session variable in Java Function in JSP
Hi Experts !!
I am developing an application using STRUTS MVC...
Very sorry if u have problem understanding my question, i ll try to improve... and sorry if i can't post codes here
Basic question is ....
I want to open a word document on pageLoad of JSP, the word document is not a single document, there is a form in which there is a "name" and "template" whenever user clicks on a button there is one action attached to it which creates a copy of that template in a different folder.. on the next page OnLoad i want to open that particular document. for that i have created a variable and also have set in the session, just want to access it in the below code.
I have a formbean in which i have a variable, the scope is session, that variable i have put it in session also. but i want to access that variable in a "java function" in JSP so that "onLoad" page that function should work.
JSP---
<script type="text/javascript">
function openDocument() {
var w = new ActiveXObject("Word.Application");
var docText;
var obj;
var a;
if (w != null) {
w.Visible = true;
obj = w.Documents.Open(I HAVE TO ACCESS THAT VARIABLE HERE);
</script>
FORMBEAN----
public class CreateSOWFormBean extends ActionForm {
private String workflowName;
private String comment;
private String sowTemplate;
private String sowFileCreated;
public String getSowFileCreated() {
return sowFileCreated;
public void setSowFileCreated(String sowFileCreated) {
this.sowFileCreated = sowFileCreated;
sowFileCreated is the variable that i have accessed in session and that value i have to pass in that function in JSP....
I am aware of something like
obj = w.Documents.Open(<%'sowFileCreated'%>);
but i m not sure how to write....
Plz help.....If you're working under a framework like struts you should definitely be using JSTL tags rather than scriptlet code to access variables within the page. With JSTL code <% codes can be almost entirely avoided.
To transfer a value from a Servlet to a JSP don't use a session variable, use a request attribute. Session variables should only be used when values have to survive from one transaction to another.
You can write something like:
obj = w.Documents.open('<c:out value="${openURL}"/>');in the Javascript portion of your JSP.
Just beware of potential problems with quotes. The coresponding code in the Servlet would be like:
request.setAttribute("openURL", openUrl); -
Problem retrieving Session variables in Flex from Coldfusion
For about a year I've been using a cfc that allows me to remote call from within Flex to retrieve session-level variables. I much prefer this to using FlashVars because with the remote call the session values don't show up in the page source.
This was working fine when I was using an Application.cfm file to manage my Coldfusion pages. However when I switched to using an Application.cfc file, the cfc stopped working. Neither the cfc or the cfm file contain any code to manage these session variables (they are set in other pages), so the only real difference seems to be changing from Application.cfm to Application.cfc.
Any thoughts why? Thanks.Ok, this is resolved.
The problem seems to have been related to the scope of Application.cfc and Application.cfm. The directory which contained the cfc files had an Application.cfm controlling the session, while the directory with the pages that included the flex swf files had an Application.cfc file. Apparently these two don't talk to each other.
The solution is to use either Application.cfc or Application.cfm files, but not to mix them. In other words, use either -- but be consistent. -
Access Session variable across the hosts
Hi,
I am facing an issue. Please find the following scenario.
I have a login page which is under a secure host. When the login is successfull, the control will be directed to a non secure host, where I have to access a session variable which is set in the LoginPage (which is a secure host). Can I do this?
Can any one help me in solving this
regards,
Jo
Message was edited by:
JoshyzJavaTo retreive a varable from another JVM or indeed another host you would need to use Remote Method Invokation (RMI), calling getSecureSessionID() or isSessionOK(sessionID) or whatever from the programme running in the remote JVM.
The method in general is floored unless the RMI is secure, I have no experience of encrypting this but I'm sure it is possible. You're non-secure-host must have the funcionality to communicate with the secure-host securly, otherwise the secure-host is not secure.
Bamkin -
Accessing session variables....urgent
Hi,
i have a session variable in my JSF application that stores the userId when a user logs in!!
i need to access the session variable in a method in the bean.
can HttpSession and HttpServletRequest objects be accessed in the managed bean
help me with the code please.....itzz urgentsee http://forum.java.sun.com/thread.jspa?forumID=427&threadID=545939
-
Accessing session variables PHP
I am trying to access a session variable from a log in form (using the Log In User Server Behavior) and am lost. I simply want to display the users information in the target page. I read in another discussion that I had to bind the variable to the target page, which I did, but that didn't fix it.
Please help.
Here is my loginFormAction code:
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
if (isset($_POST['email'])) {
$loginUsername=$_POST['email'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "owner.php";
$MM_redirectLoginFailed = "register.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_petriever, $petriever);
$LoginRS__query=sprintf("SELECT email, password FROM owners WHERE email=%s AND password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $petriever) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
header("Location: " . $MM_redirectLoginSuccess );
else {
header("Location: ". $MM_redirectLoginFailed );
?>Wherever you want to display the logged-in username simply place this on the first line of a .php page to start the session:
<?php session_start(); ?>
Then place this code wherever you want to display the username:
<?php echo $_SESSION['MM_Username']; ?> -
Hi ,
I have session variable defined using portals (forms or plsql portlets).
Can i access these variables using jsp portlets ??
This is an urgent requirement ..
Regards,
Vijaya"145822",
If your application with application id 100, for example, uses a common authentication scheme with application 200 (using the same cookie name in the case of an HTML DB style authentication scheme), then the two applications can run in the same session. A potential benefit of this, even if the two apps are not intricately related, is that the user has only to authenticate once per new session and will have access to both apps. If you set it up this way, then app 100 can access app 200's items in the same session using this function from within app 100: htmldb.application.fetch_app_item(p_item=>'ITEM_NAME',p_app=>200);Scott -
Accessing _root variable from flex
In Flex code, I am trying to access a variable that I pass to
the Flash object through FlashVars argument. In Flash it is easy to
do as all the variables that as passed as a part of FlashVars
appear as a part of _level0 or _root. Is there any way to do it in
Flex?
I am trying pass a large dataset directly to Flash without an
http call (creating a desktop application). Does anyone know if the
FlashVars approach will work for a large dataset or is there a
better approach?
ThanksFrom the Flex 2.0.1 help (search for Using flashVars):
The following example sets the values of the firstname,
middlename, and lastname flashVars properties inside the
<object> tag in a simple wrapper:
<?xml version="1.0"?>
<!-- wrapper/ApplicationParameters.mxml -->
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="initVars()">
<mx:Script><![CDATA[
// Declare bindable properties in Application scope.
[Bindable]
public var myName:String;
[Bindable]
public var myHometown:String;
// Assign values to new properties.
private function initVars():void {
myName = Application.application.parameters.myName;
myHometown = Application.application.parameters.myHometown;
]]></mx:Script>
<mx:VBox>
<mx:HBox>
<mx:Label text="Name: "/>
<mx:Label text="{myName}" fontWeight="bold"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="Hometown: "/>
<mx:Label text="{myHometown}" fontWeight="bold"/>
</mx:HBox>
</mx:VBox>
</mx:Application>
If you are using the wrapper that is generated by Flex Data
Services or wrappers that are included in the
resources/html-templates directory, your wrapper might not look the
same, but the basic approach to passing the flashVars variable is.
For example, you might insert flashVars variables by appending them
to a function parameter, as the following example shows:
"flashvars","historyUrl=%2Fflex%2Fflex%2Dinternal%3Faction%3Dhistory%5Fhtml&lconid="
+ lc_id + "&firstName=Nick&lastName=Danger", -
Hi All,
I am using cutom autentication schema called "My Auth Scheme". I want to hide some of the menu options (Tree List) based on the Role Type.
Could anybody give me any pointer about how to acheive this. And most importantly how to access the session variable (Though I am not even sure about Role Type is going into session or not). Please guide me..
Regards
Amit AroraAmit,
You're using a lot of terms that you have not defined:
I am using cutom autentication schema called "My Auth Scheme". It's an authentication scheme but what is the relevance of it being custom (in what way is it custom and how is that relevant?) and why do we care what you named it?
I want to hide some of the menu options (Tree List) based on the Role Type. "Role Type" -- What is that?
And most importantly how to access the session variable ...What do you mean? What session variable?
Please describe your exact functional requirements, what you are doing now to achieve them and how your actual results differ from the expected results. Also, show us all of the code you are using and demonstrate the problem on apex.oracle.com so we can see exactly what you're trying to do.
Scott -
Problem accessing session variables in JSP
Hi all,
i am retrieving the value of session variables in a JSP page. the session varibale
is set at the
server side. sometimes the jsp is able to retrieve the value and sometimes it
doesn't.
Thanks & Regards
Tarun
if getAttribute return null so there is no such session attribute,anyway
check your browser if cookies are enabled.
"Tarun Mangal" <[email protected]> wrote in message
news:400759e9$[email protected]..
>
> Hi all,
> i am retrieving the value of session variables in a JSP page. the session
varibale
> is set at the
> server side. sometimes the jsp is able to retrieve the value and sometimes
it
> doesn't.
>
> Thanks & Regards
> Tarun
-
Problem accessing session variable from jsp
Hi!
I get an error retrieving a session variable from inside a JSP declaration scriptlet....
Something like this code in a JSP page:
<%!
public void funtion1() {
String parameter1 = session.getAttribute("parameter1");
%>I have seen that I have available getContextServer() method and from there I could call getAttribute("parameter1") . But the thing is that the attribute I want to retrieve was stored in session by another Jsp page.
Any solutions are welcome
Cheers
VictorAppropriately the above is one the reasons also You cannot use JSP implicit objects from the declaration tag. However we can think of a small workaround by passing the reference like the one discussed below
<%!public void funtion1(HttpSession session) {
String parameter1 = session.getAttribute("parameter1").toString();
}%>
<% funtion1(session);%>Hope that helps :)
REGARDS,
RaHuL
Maybe you are looking for
-
SOLUTION to iPhoto 6 crashing without warning during library upgrade
THE PROBLEM The problem which I and some others in this forum were facing was that iPhoto 6 would CRASH WITHOUT WARNING halfway through the process of updating our previous iPhoto 5 library. This is a different problem from the permissions issues whi
-
Illustrator CS4 install error: Color EU settings
Hi everyone, I've been trying to install Illustrator CS4 for the past few days, I have updated my DirectX and all my VGA drivers in hopes of getting it to work. Every time I try, I end up with this error message: "Error: Error 1603. Error 1714.The ol
-
Effects using Object Layer Options
Under Object Layer Options I would love to be able to apply effects to individual layers. If I can view / turn "off" or "on" individuals layers, then why not be able to apply effects as well? For instance: say I have an image of an apple photographed
-
User Feedback: T540p with 3K display
Dear Lenovo, I recently got my new T540P with 3K display and I like to give feedback. Display: It is really a stunning experience. Especially after having used a 1600x900 resolution before. Thank you!!! Keyboard: Great keyboard with some issues. The
-
Swedish letters in an iPhoto Book?
Hi! I have now finished a 50 pages iPhoto Book. I like to order it but I have used Swedish letter å, ä, and ö. Will they be able to print that? Won't send it away and get the book back with weird looking letter substitutes. Thanks Maria