Session trouble
I am setting up a shopping cart app and am running into some
issues... in my Application.cfc, onSessionStart I am creating an
object instance of User in the session:
<cffunction name="onSessionStart" returnType="void"
output="false">
<cfset SESSION.user =
createObject("component","User").init()>
</cffunction>
The User.cfc looks like this:
<cfcomponent>
<cffunction name="init" access="public"
returntype="struct">
<cfset var user = structNew()>
<cfset user.userID="#createuuid()#">
<cfset user.cart = createObject("component",
"ShoppingCart").init()>
<cfset user.info = createObject("component",
"UserInfo").init()>
<cfreturn user>
</cffunction>
</cfcomponent>
The ShoppingCart.cfc starts like this:
<cfcomponent output="false">
<!--- Initialize the cart’s contents --->
<cffunction name="init" access="public" output="false"
returntype="ShoppingCart">
<cfset VARIABLES.cart = ArrayNew(1)>
<cfreturn this />
</cffunction>
and the UserInfo.cfc starts like this:
<cfcomponent>
<cffunction name="init" access="public" output="false"
returntype="UserInfo">
<cfset VARIABLES.info = StructNew()>
<cfreturn this />
</cffunction>
Is this a proper way to set this up? I have gotten some
intermitant session errors (e.g. "user.info.something is an
undefined java...")
Also - are there any issues/best practices that I ought to be
aware of that could arise with customers using tabbed browsing or
multiple browser instances?
Thanks in advance!
Andy
Thanks!
In a similar vein, I recently switched to using Jsession
variables because I was concerned with unjudicious use of server
memory when this goes live.
Interestingly, even when a tab is closed (or a new site is
opened in the same tab) the session is still alive. It's not until
the browser is closed and restarted that the session ends. Is that
what is supposed to happen?
Similar Messages
-
i am having some trouble configuring my usb x-session to control certain aspects of logics performance etc. where in logic pro 7 can i go to access the control menu to assign my usb controller with whatever functions i desire?
open Preferences>Control Surfaces
Check also the Logic pro reference guide about control surface support.
Hope this is what you are looking for -
After opening certain websites, pogo, firefox 4.0.1 closes with no error message. When I restore the session I get: Well, this is embarrassing. Firefox is having trouble recovering your windows and tabs. This is usually caused by a recently opened web page.
I have had this problem before and had to reinstall an earlier version of firefox.
The error console has a long list of errors, many of them end with: does not implement nsIObserver. Is there a way to send the information on the error console to firefox support?
Redownloading Firefox 4.0 will fix my problem until I either close firefox or turn off my computer. The problem recurs when I open firefox again.See:
* http://kb.mozillazine.org/Firefox_crashes
* https://support.mozilla.com/kb/Firefox+crashes
It is also possible that there is a problem with the files [http://kb.mozillazine.org/sessionstore.js sessionstore.js] and sessionstore.bak in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder]
Delete the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
* Help > Troubleshooting Information > Profile Directory: Open Containing Folder
* http://kb.mozillazine.org/Profile_folder_-_Firefox
* http://kb.mozillazine.org/sessionstore.js
If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.<br />
Deleting sessionstore.js will cause App Tabs and Tab Groups to get lost, so you will have to create them again (make a note).
See:
* http://kb.mozillazine.org/Session_Restore -
Trouble with session variables
Hello, I am a user of cf for a number of years, but only
lately as of last week have I had the opportunity to work with CF
8.... wow the changes are quite intimidating. But none the less
press on is my thought, so now my trouble. Thing I did was to start
using application.cfc vs application.cfm, as it would appear that
is how things have come to pass. So I looked around and found this
code to set session management:
<cfcomponent output="false" hint="Handles application
level events.">
<!--- Set up the application. --->
<cfset THIS.Name = "AppCFC" />
<cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 0, 60,
0 ) />
<cfset THIS.SessionManagement = true />
<cfset THIS.SetClientCookies = false />
<CFSET request.dsn = "wlaw" />
</cfcomponent>
My problem is that while I can define a session variable on a
page that is not under the SSL cert, my session vars become
undefined once I land on a page under SSL.
Am I missing something? I dont recall this being a problem in
the past. All help is appreciated.
as to setting the var, it is done on an index page which
calls another page in a different directory, but under the same
server,.
<cfset session.ref="foo">
the only changes are that the result page or action page if
you prefer is now under the ssl and the var becomes undefined.
thank you in advance
Mike Doolyis the object being put in session context serializable.. Also in
other to avoid any generated classes issues delete all the classes
whcih weblogic generates as part of deploying the application. That
should atleast mitigate one explanation for your problem.
Hope this helps
~a
[email protected] (Gabriel Ornelas De Luna) wrote in message news:<[email protected]>...
> Hello everyone,
> I'm currently working with WL 6.1 and I'm having trouble with the
> persistence of some session variables which are initially created
> correctly on the server side, and they get lost (null) once the Web
> clients need to access its value.
> This is the error which is being written on a log file:
>
> <May 13, 2003 3:05:09 PM EDT> <Error> <HTTP Session> <Could not
> deserialize session data
> java.io.NotSerializableException:
>
> Things were woriking perfectly, but suddenly after bouncing the server
> instance several times, in order to pick up the latest changes in my
> classes, I started to get this error once the server tries to load the
> jsp.
>
> JSP Code:
> <%
> Integer businessID = (Integer) session.getAttribute("business_id" );
> Util.isCapitolBusiness(businessID.intValue())
> %>
>
> I appreciate your help.
> Regards.
> g.
-
I am trying to update my iPod touches and keep getting an error message saying iTunes could not back up my iPod because a session could not be started. I have followed all trouble shooting advice found on the apple website, unplugged and replugged the device, restarted my computer, etc. Any suggestions would be much appreciated. Thanks
I have the same issue, except I can't even sync.
-
Hi, ive been having trouble passing my logic sessions to another computer, we're both using a macbook pro 10.6.8 and logic pro 9 with the same plugins (native instruments komplete 7), the session opens in the other computer but all the synths reset to presets, this didnt happen the first time I shared a session, but its been happening lately quite often
kwmlr439 wrote:
CSOUND Read the title please:
Re: Macbook Pro 10.6.8 RAM Upgarde to 8 GB
The amount of RAM is not dependant on the operating system. It is all about the model of you Mac.
10.6.8 is the version of OS X that is installed on your system. It has no real baring on the amount of RAM that CAN be installed.
Personally I have never had good luck with Corsair RAM. I have always had good luck with Crucial and Kingston.
Message was edited by: Shootist007
Message was edited by: Shootist007 -
I am having trouble moving files from iphoto to a thumb drive. During the same session sometime I can move 10 photos at a time, the next time I can only move one photo and sometime no photos will move. I also have trouble downloading photos to the internet. I was using a MacBook Pro and had no problems like this. I then upgraded to the MacBook Pro with Retina Vision and this is the computer I am having problems with. Can anyone please give me a suggestion in how to fix this problem. THANK YOU.
iPhoto problems should be posted in their forums.
I also have trouble downloading photos to the internet.
Needs clarification. You upload from your computer to the internet & download from a website/internet to your computer. So which are you trying to do? Either way, sounds like a browser issue. You need to post in the forum of whichever browser you are using. -
Trouble setting the session state of a select item.
Hi,
I have a requirement whereby I need to change the session state of a select list item in my form without the need to submit. I am using Application Express 4.1.0.00.32. I thought this would be straight forward using a dynamic action or javascript and calling an on demand process for example.
P1_MY_SELECT onchange="set_option();"
function set_option() {
var l_option=$f_SelectValue('P1_MY_SELECT');
alert( 'My new value is ' + l_option );
// ON DEMAND Set the new session state value
var lRequest = new apex.ajax.ondemand
('SET_P1_MY_SELECT',function()
{ /* start the return function */
var l_s = p.readyState;
if(l_s == 1||l_s == 2||l_s == 3)
else if(l_s == 4)
{ gReturn = p.responseText;
(gReturn)?json_SetItems(gReturn):null;
else{return false;}
/* end the return function */
lRequest.ajax.addParam('x01', l_option );
lRequest._get()
My on demand application process
DECLARE
l_options varchar2(2000) := wwv_flow.g_x01;
BEGIN
APEX_UTIL.SET_SESSION_STATE('P1_MY_SELECT',l_options);
apex_util.json_from_items('P1_MY_SELECT');
END;
Is there a better method to set the session state of my P1_MY_SELECT other than what I am doing as above or can you tell me why the session state of P1_MY_SELECT is not changed?
Thanks.
Edited by: 968358 on 01-Nov-2012 08:40if you are on 4.1 why don't you use a dynamic action instead of writing the code again?
create a dynamic action like this
Event: Change
Source Type: Item
Item: P1_MY_SELECT
True Action:
=========
Action: Execute Plsql Code
Plsql Code: null;
Page Items to Submit: P1_MY_SELECT
Page Items to Return: P1_MY_SELECT (this is optional)
http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/advnc_dynamic_actions.htm#HTMDB27020 -
Trouble installing akamai net session
I figured out why i couldnt watch NFL Videos and fixed it, but now the NFL added HQ videos that can only be watched with akamai net session so i downloaded the install file and double clicked it and an error shows Failure to install client: Network Failure. Aborting install.
Any help would be appreciatedforget this.... I ordered the wrong platform :-(
-
Having trouble with session.setAttribute()
Hi,
I'm trying to attach the current time to the sessionID as follows but it is not working.
long stime = System.currentTimeMillis() / 1000;
session.setAttribute("stime", stime);
Then I want to call it later on....
long stime = session.getAttribute("stime");
None of this is working. Can someone help me please...
thanks,
kramerHello,
Capital "L" Long is the Object representation or "wrapper" of a long (lowercase "l"), which is one of the basic types called primitives and is a reserved keyword in the Java Language.
As for uses, if you are simply dealing with long values in terms of basic arithmetic functions (+, -, *, /, etc.) then the primitive type will work fine. If you need to do fancier things, like conversion to another type, String representations, storage in a HashMap as an Object, etc. then that is for what the wrapper class is intended.
Good luck,
Ken -
Trouble with Session Management
I am trying to assess how many people I lose on my site
because they dont have cookies enabled. when I disable cookies in a
browser and <cfoutput> a urltoken, it prints out a new value
every time I refresh the page, as expected. But when I try to log
the CFID when people come to my home page so that I may pass it
around through the site, I get some "element CFID undefined in
session" errorsthanks for the help. I thought Id tell you more about what I
am doing and see if you have comments - we use google to market our
company so clicks are costing us big bucks. currently, our sites
rely on session management to operate, so I realize that folks
having cookies off is really hurting us. All the references I can
find tote passing the session.URLToken around the site to make it
cookie independent. I havent done this yet, first im trying to get
a handle on how many people have cookies off (like you are), and
where people are coming from to see if we are having click fraud
(which we are very suspicious of).
Is this what you would do (passing the URLToken around)? Any
other comments you have would be very much appreciated. -
Trouble with session handle???
Hi everybody, its me again... i solve part of my problem but now i have another problem thats bothers me....my scenario is the follow: i have an app running in a portal, then i have a link in the portal who bring me a pop up of the active page of that app, that is shown on the portal in that moment. when i call the pop up, some class attributes change its values for do something, when i close the pop up, those class attribute refresh and take its initial values (values necessary to run correctly in the portal) BUT, when i minimize the window (no close it) and start to manipulate the app in the portal (the app is statefull), the values stay the same as if i was operating the app in the pop up and obvious do something that it should'nt do. My question is: there is some way...may be with session handler like sap-sessioncmd (i test it but it doesnt work), that help me to manage diferent session for the pop up and the app running in the portal...or may be some parameter (that is pass it via url) that help me to create another object of the class when i calls the pop up
thanks for the help. I thought Id tell you more about what I
am doing and see if you have comments - we use google to market our
company so clicks are costing us big bucks. currently, our sites
rely on session management to operate, so I realize that folks
having cookies off is really hurting us. All the references I can
find tote passing the session.URLToken around the site to make it
cookie independent. I havent done this yet, first im trying to get
a handle on how many people have cookies off (like you are), and
where people are coming from to see if we are having click fraud
(which we are very suspicious of).
Is this what you would do (passing the URLToken around)? Any
other comments you have would be very much appreciated. -
hi,
I am using "request.getSession(true)" statement .So i think i shud get a new session each time i'll start the browser.
But each time when i am starting browser it is showing me the previous values, stored in text boxes.
And when i'll shutdown tomcat and restart then only browser works properly.
I m not able to understand evem the problem.
can anybody give me some idea?
manishhi evnafets,
Ya u r right i m storing values in session context with setAttribute() command.And this statement is in servlet which calls the jsp page and in jsp page i m using session.getAttribute() to get values and these values i m inserting in some text boxes.
Exact codes are:
String selected_tables=(String)session.getAttribute("selected_tables");
<td>Selected Tables </td><td>:</td><td><input type = "text" Name = "sel_table" <%if (selected_tables==null)%>value=""<%else%>value="<%=selected_tables%>"></td></td>
I m using IE vers.6.0
I tried <%= session.getId() %> and it is giving new id each time i reopen the browser that means browser is working properly.
But even now i m not able to understand when the session is new ,why in text boexs previous values are coming.
is it necessary to use setMaxInactiveInterval() .I m not using this bcz i don't want it now.
And when i m restarting tomcat then why it starts working porperly.Is that a problem of tomcat or my program itself.
Anyway thanx for thsi much
manish -
Trouble running a simple session bean
I am trying to run a simple stateless session bean given in the book Head First EJB. For this purpose, I am using j2sdkee1.3 and j2sdk1.4.2_08. I successfully started the j2ee server and managed to deploy the bean. But when I try to run the client, I get the following cryptic error:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/corba/se/internal/util/JDKBridge
at com.sun.corba.ee.internal.core.IOR$LocalCodeBaseSingletonHolder.<clinit>(IOR.java:79)
at com.sun.corba.ee.internal.core.IOR.<init>(IOR.java:218)
at com.sun.corba.ee.internal.iiop.messages.LocateReplyMessage_1_2.read(LocateReplyMessage_1_2.java:137)
at com.sun.corba.ee.internal.iiop.IIOPInputStream.unmarshalHeader(IIOPInputStream.java:126)
at com.sun.corba.ee.internal.iiop.IIOPConnection.getResponse(IIOPCoonection.java:670)
at com.sun.corba.ee.internal.iiop.IIOPConnection.send(IIOPConnection.java:777)
at com.sun.corba.ee.internal.corba.InitialNamingClient.locateObject(InitialNamingClient.java:786)
at com.sun.corba.ee.internal.corba.InitialNamingClient.getIORUsingHostInfo(InitialNamingClient.java:597)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveCorbaloc(InitialNamingClient.java:573)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveUsingORBInitRef(InitialNamingClient.java:544)
at com.sun.corba.ee.internal.corba.InitialNamingClient.cachedInitialReferences(InitialNamingClient.java:1080)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolve_inital_references(InitalNamingClient.java:981)
at com.sun.corba.ee.internal.corba.ORB.resolve_initial_references(ORB.java:2358)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:55)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:154)
at javax.naming.InitialContext.lookup(Unknown Source)
at AdviceClient.go(AdviceClient.java:16)
at AdviceClient.main(AdviceClient.java:10)
I have set my classpath to the following:
CLASSPATH=.;%J2EE_HOME%\lib\j2ee.jar
I would really appreciate if somebody could help me with this error. Thank you.There is a ClassDefNotFound Exception, this means that a class used (probably by the corba marshalling stuff) cannot be located. You'll need to add these classes to the client's CLASSPATH.
Usually a client-jar file can be created or is provided by the j2ee server. If you're using the sun-wapp-server then it is done this way:
- deploy the beans to the server (asadmin deploy)
- create the client-stubs (asadmin client-stubs)
- add the created client-stubs to the clients class path.
I don't remember the exact commands for asadmin. Plz check the help. (asadmin help)
In JBOss youll have to add jboss-all.jar to the client's classpath. It depends on the j2ee server you use. -
new to Jsp, previously Asp programmer. I'm not getting a session value returned. The first page the user puts in password and username, and the form is submitted to a jsp page. This page checks the database for validation. This works fine, it redirects to a main page when valid. I want to then just get the userid and display it (just to see if the session is working) on the previous page when I enter a non-valid password. I don't get any errors just userid = (nothing) ?? Any suggestions? Thanks for the help!!
page 1 snippet --
<%
// first time make it true, then make it false to continue using the same session.
session = request.getSession(false );
// later, you'll want to go get userID this way.
Sting User = (String)session.getAttribute("USER");
%>
User = <%=User%>
page 2 snippet --
String Password= request.getParameter("Password");
String sql = "Select userID FROM Web_User WHERE PASSWORD = '" + Password +"'";
(works fine)
...further down --
HttpSession session = null;
// first time make it true, then make it false to continue using the same session.
session = request.getSession(true);
// whatever fuction to go get the userID
String userID = userID ";
// set user id to session
session.setAttribute("USER",userID);3) try to capture password as a session -
String Plwork= "Password";
session.setAttribute("USER",Plwork);
This will place an attribute in the session
The attribute name = "USER", value = "Password"
Is this what you want?4) show password on another page after redirect -
<% session = request.getSession(false);
String PWord= (String)session.getAttribute("Plwork");
%>
PWord= <%= PWord%>
You should not have to do a request.getSession(false);
The session should already be there.
With the code that you have provided there is NOT an
attribute called "Plwork". So, you should get back
a null Object.
Hope that helps!
Maybe you are looking for
-
How Do you download Music from one Apple Id to a computer signed in with A different Apple Id
Hi, I have my own apple Id and nobody else but me uses it, and my sister has her apple id and she just uses her iphone to buy things not her computer and there is some songs on her iphone that i'd like to have in my library to put on my devices but I
-
How to change the author and "podcast website," in iTunes store?
Hi, my itunes store page is http://itunes.apple.com/gb/podcast/the-fallacy-a-day-podcast/id469610386 and my podcast is hosted on a free account at Podomatic. It seems that the information on that page is drawn from the data on my Podomatic feed, incl
-
MAC Addres in http header information
HI I need to have remote machine's mac address. Can somebody tell me whether the Http Request submitted from client's desktop contains the Mac Address of that Network. Thanks in advance. Tushar.
-
Nested perform on commit error
hi all,happy new year 2006 in my custom transaction upon save, iam calling a Func module in update task passing all the internal tables which contain the update data. inside this FM iam doing table updates without commit and also calling change docum
-
I want to make the best you-tube videos
I got AVCHD, I got the encoder...where do I start ???