Session vars, CFCs and CFHTTP
Hi guys
I'm using session vars to maintain whether or not a user is
logged in on our site. The only problem is is that the session vars
seem to be lost after I call a CFC that then does a CFHTTP post.
Does anyone know how I maintain the session vars?
I'm using CF MX 7
All the best
Wez
wezcornell2008 wrote:
> Hi guys
>
> I'm using session vars to maintain whether or not a user
is logged in on our
> site. The only problem is is that the session vars seem
to be lost after I call
> a CFC that then does a CFHTTP post.
>
> Does anyone know how I maintain the session vars?
>
> All the best
>
> Wez
>
Why do you say they are lost? Are you sure you did not just
misplace them?
In other words nothing about CFC's or CFHTTP would
intrinsically destroy
session variables in memory. But they could easily not have
access to
the scope as you desire if you do not understand how
templates and cfml
code are associated with a given session scope when it is
running in memory.
Similar Messages
-
Session Vars and Local Firewalls
I've been getting more complaints lately that session vars
are getting lost and normally I walk them through making sure
cookies are enabled, but now that doesn't seem to be always the
case anymore and have finally isolated it to when they install a
firewall. If they disable it works, but when on it doesn't. Is
there anything I can do besides telling them not to use their
firewall?
Server specs:
ColdFusion MX 6.1 on a non-clustered environment.
User:
Using IE and using "e-trust EZ Armor"I assume then, you are storing variables in cookies, rather
than registry or database then, correct?
Are these local firewalls? (on the actual PC) or H/W on a
network?
If they are local, the firewall itself may be eliminating the
cookie storage, not the browser ... if it is, it likely has a way
to change the settings.
There's not much you can do if you are forced to use cookies
for sessions (which is very common) other than altering your coding
or having the user change their settings.
If you have access to the CF admin, you may try setting up a
DB service for variable storage, which is an option. -
ok, I set a session var to about 2K of text
I have an iframe which is part of a menu navigation system.
The content of that iframe is slow to get from the DB so I
cache the HTML for it into a session var.
If a user clicks a link, the iframe submits to itself, does
a few things, and then cflocation's out to the chosen page.
The next time this iframe is loaded( almost immediately) it
reads the session var and it is EMPTY!
I'm not overwriting it, not structDelete'ing it, Any time I
set it outside of this page, it's done with a check to see
if it isDefined first, and if so, does nothing.
Are there known issues with CFParam? large text session vars?
WTF?
D.dnagel wrote:
> ok, I set a session var to about 2K of text
>
> I have an iframe which is part of a menu navigation
system.
> The content of that iframe is slow to get from the DB so
I
> cache the HTML for it into a session var.
>
> If a user clicks a link, the iframe submits to itself,
does
> a few things, and then cflocation's out to the chosen
page.
>
> The next time this iframe is loaded( almost immediately)
it
> reads the session var and it is EMPTY!
>
> I'm not overwriting it, not structDelete'ing it, Any
time I
> set it outside of this page, it's done with a check to
see
> if it isDefined first, and if so, does nothing.
>
> Are there known issues with CFParam? large text session
vars?
>
> WTF?
>
>
> D.
So, I pulled out Fiddler, and lo and behold I was
making a call to my page with no params at one part
of the load and then later on, calling it again
properly with the correct params. I'm checking
for an empty URL param set now and all is well...
Thanks for your time on this folks!
D. -
I'm trying to assign session. var to domain names. E.G
(mydomainname.com) and (somthingdiff.com)
so if user went to mydomainname.com then went to
somthingdiff.com this would contain the same session.var.I don't think you can do that. You are ending a session on
mydominname.com and starting a new one on somthingdiff.com. Pass
your variable in the URL. -
How to prolong the bluetooth timeout session on ipad and iphone
how to prolong the bluetooth timeout session on ipad and iphone?
I understannd that the standard timeout setting is 3 mins. what if I want to prolong the connection duration, how should I do?
thanksTo my knowledge, there is no "time out" on a device. A mouse, KB, etc will go into a low power mode after a short period of non-use.
Barry -
hey there, Kindly elaborate me the difference Between Set and Select clause while Providing value to a Variable or Even a Column.
Declare @var nvarchar(Max)
Set @var= (Select TestName+ cAst(TestId as nvarchar) from TblTest where TestID=1)
Insert into TblTest(TestName)
Values (@var)
Declare @var nvarchar(Max)
Select @var= (Select TestNAme + Cast(TestId as Nvarchar(MAx)) from TblTest Where TestID=1)
Insert into TblTest(TestName)
Values(@var)
Values and result I am getting is Same in Both.
But just wondering if there is any Difference. and if Any which Should I prefer.
And Which one uses less Resources.I like this article
http://vyaskn.tripod.com/differences_between_set_and_select.htm
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Only in a admin session works InDesign and Illustrator!
When I open some products (Indesgin for example) in a session without admin permission, it doesn't work. All is well y I open the software in a admin session but I don't like to use admin session normally, only for instalations.
It's not so safe to work continously in an admin session, and I don't want to do it.
Could you help me?Adobe InDesign downloaded from Adobe Creative Cloud, It´s supposed last
version of CS6. S.O. Windows 7
When I try open in a non admin session Windows shows a message: Windows has
closed correctly this program by an error
Thank,
Alejandro Sancho
2013/3/2 Steve Werner <[email protected]>
Adobe Community <http://forums.adobe.com/index.jspa> Re: Only in a
admin session works InDesign and Illustrator! created by Steve Werner<http://forums.adobe.com/people/Steve+Werner>in
InDesign - View the full discussion<http://forums.adobe.com/message/5115207#5115207 -
Hi all, I have small js that is being called when a radio button is clicked. I need that to set a cf session var which will have the radio value so that when the page refresh it will remember what is selected...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<cfif cgi.PATH_TRANSLATED CONTAINS 'index.cfm'>
<cfoutput>
<META HTTP-EQUIV="refresh" content="60;URL=http://#HTTP_HOST#/NEA/index.cfm?location=ALL">
</cfoutput>
</cfif>
<script type="text/javascript">
function select_location(select_me){
window.location ="index.cfm?location=" + select_me.value;
</script>
<input <cfif url.location eq "NM">checked="checked"</cfif> type="radio" name="location" id="NM" value="NM" onClick="select_location(this);"><label for="NM">NM</label>
<input <cfif url.location eq "SM">checked="checked"</cfif> type="radio" name="location" id="SM" value="SM" onClick="select_location(this);"><label for="SM">SM</label>
<input <cfif url.location eq "BQ">checked="checked"</cfif> type="radio" name="location" id="BQ" value="BQ" onClick="select_location(this);"><label for="BQ">BQ</label>
<input <cfif url.location eq "MV">checked="checked"</cfif> type="radio" name="location" id="MV" value="MV" onClick="select_location(this);"><label for="MV">MV</label>
<input <cfif url.location eq "SI">checked="checked"</cfif> type="radio" name="location" id="SI" value="SI" onClick="select_location(this);"><label for="SI">SI</label>
<input <cfif url.location eq "BR">checked="checked"</cfif> type="radio" name="location" id="BR" value="BR" onClick="select_location(this);"><label for="BR">BR</label>
<input <cfif url.location eq "HV">checked="checked"</cfif> type="radio" name="location" id="HV" value="HV" onClick="select_location(this);"><label for="HV">HV</label>
<input <cfif url.location eq "ALL">checked="checked"</cfif> type="radio" name="location" id="ALL" value="ALL" onClick="select_location(this);"><label for="ALL">ALL</label><br>JavaScript runs on the Client. ColdFusion runs on the server. They do not talk to each other or share memory.
The only way to get data from the client to the server is to make a request. The only way to get data from the server to the client is to respond to a request.
You can make that request by submitting a form either in the get or post scope.
You can make that request by sumitting a request with the xmlHTTPrequest() function, commonly called AJAX.
But somehow or the other you have to make a request. -
Get the session trace files and also the TKPROF reports for storedprocedure
Hi ,
I am trying to find out the bottlenecks on a storedprocedure, which does a insert into a table, where the target table has lot of indexes/constraints, so i want to see, which indexes/constraints is causing the problem. so in order to do I want to get the session trace files and also the TKPROF reports to see the bottlenecks for a oracle stored procedure,
Could you please give us the list of steps to get the tracefiles and tkprof reports.781649 wrote:
Thanks for input, i am using oracle10g standard edition. i dont think i have these tools available (DBMS_PROFILER or DBMS_HPROF). Did you even bother to try the following?
SQL> DESC DBMS_PROFILER
SQL> DESC DBMS_HPROF
I understand it would be too much to expect you to actually Read The Fine Manual
I am using bulk collect for all in my storedprocedure to insert the rows into a big table. In order to perform analysis on this bulk collect which tool will help me to identify the bottlenecks .
I want to compare background session properties for both runs (like inserting the data with indexes/constraints vs without indexes/constraints). please let me know..I am willing to bet you the problem/slowness is on the SELECT side & not the INSERT!
Just Curious
Handle: 781649
Status Level: Newbie
Registered: Jul 12, 2010
Total Posts: 35
Total Questions: 17 (14 unresolved)
Why so many unanswered questions?
Edited by: sb92075 on Jan 17, 2012 3:13 PM -
when i try to open my Yahoo mail, a small green box flashes with a message saying my session has expired and to sign in. when i do, the same thing happens and i am unable to get my mail.
Welcome to Apple Support Communities. We're users here and don't speak for "Apple Inc."
If you haven't already tried again and been able to successfully connnect, try again. If necessary, Quit Mail, and re-open it.
Some errors aren't caused by anything we're doing wrong, or problems with our equipment.
Major web service providers like Yahoo! experience 'downtime' now and then, sometimes planned, sometimes unplanned.
During the time you posted your question (about 18 hours before I post this message with the chart) Yahoo was 'down' as indicated by end-user reports, and illustrated by the colorful bands in the chart below.
www.downrightnow.com is just one of several places where the downtime of popular internet destinations is tracked. -
NEW SESSION - Firefox, IE and GLASSFISH
Hi all,
Here is my issue:
I have One application on Glassfish using EJB3,JPA and JSF.
Users can log to this application and have severals sessions opened simultanoulsy as each session is having a connection to its own database
How do I force a new session (particularly in Firefox as IE<=8 has no issue) and have the user using the same application but different databases in different tabs or windows of Firefox.
I tried almost all and get blocked
Many thanks in advance for your answers
NicogHi BalusC
Great Blog by the way...
Let me explain.
My architecture is as follows: using JSF, Glassfish and ...SQL Server!! (! i know but this is mandatory requirement as our application is full web version of an existing ERP application already sold and installed by more than 1000 of our customers...
I am using
JSF-->JSF Managed Bean (Session for some and Request for almost all when logged )-->EJB Interface-->EJB Impl-->Entity-->Database
I have a persistence Unit (using JTA and CMP) per database , each using a connection pool managed by Glassfish.
At the begining of my application, the user (when logging), choose a database, ...enter logging info and connect.
All databases have the schema but not the same data
You have to see in our case, a database as a company with particular configuration, customers, orders, invoices, contacts....
Our application is ERP that our customers uses to managed several companies simultanously .
Also, I need Session Scope as there is configuration data that I need to keep over all pages.
This configuration data is depending on the database connected to.
When selecting the database (company) for combo in logging form, The only way I found is fisrt to check is database(company) exists and can be connect to using at first begining Persistence.CreateEntityMangerFactory.. (i know that this is not J2EE and CMP but merly used in Java SE environments..).
This step is only used for checking database
Then, if creation did not generate a Persistence Exception , I can the use CMP and an EnityManger in EJB by JNDI lookup (as DI is not possible because you need constant in unitName)
ex :
@PersistenceContexts({
@PersistenceContext(name="pu/SOCIETE1", unitName="SOCIETE1"),
@PersistenceContext(name="pu/SOCIETE2", unitName="SOCIETE2"),
@PersistenceContext(name="pu/SOCIETE3", unitName="SOCIETE3"),
@PersistenceContext(name="pu/SOCIETE4", unitName="SOCIETE4"),
@PersistenceContext(name="pu/SOCIETE5", unitName="SOCIETE5"),
@PersistenceContext(name="pu/GENESYS_EXEMPLE", unitName="GENESYS_EXEMPLE")
@Stateless
public class SomeEJB extends CommonEjbImpl implements SomeEJBLocal {
private EntityManager em;
@PostConstruct
public void init() {
String puName = (String) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("database"));
em = (EntityManager) new InitialContext().lookup("java:comp/env/pu/"+puName);
@PreDestroy
public void cleanup() {
if (em != null && em.isOpen()) {
em.close();
}All works perfectly under IE6,IE7 and IE8 (forcing some parameter at launch of IE8).
But due to session management of Firefox (sharing session cookie among all exe or tabs)...session data is kept when opening a new tab.
What I did to avoid confilcts, is to clear FacesContext SessionMap when redirecting to Login page ...but i still can NOT log to multiple PU simultanously....
I do not see where DAO pattern could help me ...
Am I missing something here?
Many thanks in advance for your quick answer
Regards,
Nicog -
Shouldn't /var/run and /var/run/lock point to absolute paths?
I have a setup with my 'var' on a separate partition that causes /var/run and /var/run/lock to point to nothing each time I upgrade the filesystem package and I wonder if this is a bug.
Mounted at /mnt/data is a luks encrypted partion where I keep my home and var as subdirectories. Two symlinks point to them from root:
# ls -al /
lrwxrwxrwx 1 root root 14 Apr 21 2011 home -> /mnt/data/home
lrwxrwxrwx 1 root root 13 Apr 21 2011 var -> /mnt/data/var
Each time I upgrade the filesystems package however I end up with /var/run and /var/lock pointing to '../run' and ../run/lock', which in my case are the non-existing /mnt/data/run and /mnt/data/run/lock. I have to delete the symlinks and make them link to the absolute /run and /run/lock. Is there a reason the symlinks are relative instead of absolute?
[edit]
(this should have been posted in 'Pacman & Package Upgrade Issues' instead of here.)
[edit]
Last edited by rwd (2012-06-24 18:14:08)Thanks! After using bind mounts and reinstalling the filesystems package the relative links work. Still I wonder why using bind mounts instead of symlinks is the 'correct' way. The only advantage I see is to have the ability to use mount options, which In my case I don't need.
-
LR 4 RC2 ...vexing problem, 3 sessions with support and still not able to find? With all settings reset and running a test catalog a raw image when opened in develop will when imediately going back to library view show a significant color shift in red, orange and purple but only in images with significant content in those colors. at first the culprit appeared to be camera calibration default but not reproducable. The problem exists even when opening older images from months ago? Also if second screen running in loupe mode the image is not shifted.
Any ideas please
DaveJim01403, Geoff and others...I'm new here so I'll need a little time The thread is very interesting, populated by serious mature people, how refreshing! It clearly is part of what i'm experiencing and is answered answered here...thank you. My main problem is still the significant color shift between develope and library modules. I'll attach one from each so you and others can see. Unfortunately the library version is the bad one so printing is now very problematic...Note, this occurs in either single or with second monitor on the library version is displayed. I have reset virtually everything and wonder if a cache is not updating or color space is not matching? A symptom/detail worth noting, when switching to library mode, the correct image is displayed for about a second then it jumps to what you see in the examples. As if the library module starts to rendering from develope settings then jumps tback to the original inedited preview??
Maybe just go back to 3.6 and tread water till 4.1 is fixed?
Dave -
Delete a session var(struct)
Is there a way to delete a session var(struct) rather then
just clear it?
Thanks in advance!I'm hoping to struct completely. Is that possible?
I am presuming that you meant to say something like "to
destroy the
struct completely". If so, just set the variable to something
else.
I.E.
<cfset aStruct = structNew()>
<cfset aStruct.aKey = "foobar">
<cfdump var="#aStruct#">
<cfset aStruct = ""><!--- Some sort of NULL would
probably be nice here
but CF does not do really NULLS --->
<cfdump var="--->#aStruct#<---"> -
How does c:url tag know when the session is cookieless and thus to redirect
i have been looking at the source code for c:url tag and can't figure out how they are doing that. I need a way to do that in a jsp, to check if the cookies are allowed or not.
how does c:url tag know when the session is cookieless and thus to redirecthuh?
What do cookies have to do with redirecting?
Cookies get encoded into a URL using the method in HttpServletResponse: response.encodeURL() or encodeRedirectURL().
That method determines whether or not it prints out the session id as part of the url, or it gets uses cookies.
You can try: request.isRequestedSessionIdFromCookie().
If that is true, you know that session cookies are supported (or at least that one was)
Maybe you are looking for
-
I am unable to restore my backups from my Time Machine
MacBook Pro – My reformatted system that won't restore from my time machine - HELP PLEASE I loaded Lion when it first came out and all my troubles started. (It was the same on my 24” iMac). Mail particularly hardly worked on either machine af
-
Reporting from more than one infocube and also from multiple ODS
Hi all, Someone please help me in these issues. How can we do reporting from more than one cube ( if data in all the cubes are required, but only a few fields from each cube). And how to do the same with more than one ODS. Thanks in advance,
-
I have created an application under Labview 8.2 and am now trying to create an installation which will enable me to run this executable on a target computer. I have specified Labview Runtime Engine 8.2 but when I try to run it on the taget pc the ins
-
Can i create temp tables in command?
I need to create 5 temp tables and then use in CR for display. can this be done in Command?
-
I can't get to the Creative Cloud app
I can't get to the creative cloud app. When I open "Creative Cloud" - the window opens and then immediately minimises. When I maximise - there is a weird small window in front of the CC window, which you can't close (it just displays the CC icon). I