Session Variables Randomly Lost between Pages
My web page uses a session to keep track of who logged in.
What I noticed is that the session variables stored appears and
disappears randomly on different pages. The wierd thing is that my
code is very simple.
For the life of me I can not figure this out....
I go through a hosting company and do not expect them to do
any load balancing.
What are sticky sessions?
The cflocation tag also has the addtoken="yes" to it now and
symptoms persist.
I tested the case with
sessiontimeout=#CreateTimeSpan(0,2,0,0)# instead of the
sessiontimeout=#CreateTimeSpan(0,0,120,0)# and symptoms still
persist.
Any other suggestions? I think I ran into a wall
here....
Similar Messages
-
Session variable being lost between parent and include file
I am running into the following scenario: Page 1 includes page 2, on both pages a session variable is returned to the screen. On occasions, page 2 throws an error on the session variable even though it was successfully called on page 1.
It only happens occassionally, and is very difficult to recreate in order to debug it in realtime. Has anyone run into something like this before? Thanks!semi star gazer wrote:
I am running into the following scenario: Page 1 includes page 2, on both pages a session variable is returned to the screen. On occasions, page 2 throws an error on the session variable even though it was successfully called on page 1.
It only happens occassionally, and is very difficult to recreate in order to debug it in realtime. Has anyone run into something like this before? Thanks!
I suspect it has less to do with page-inclusion, more to do with the code on page 2. Suppose, instead of using cfinclude, you had copied the code from page 2 into page 1, and made 1 page of it. Then the error would still have occurred. That's at least my theory.
Have a look at how the code in page 2 handles the session. There is bound to be something not quite right about it. What kind of error do you get anyway?
Runtime debugging can be as simple as this:
<cftry>
<cfinclude template="page2.cfm">
<cfcatch type="any">
<cfdump var="#cfcatch#"><cfabort>
</cfcatch>
<cftry> -
Session variable not passing between pages
Hi, I've got a form that calculates checkbox values and puts them in a total field called txtTotal. When the user clicks send, I need to pass the total to a payment page. The form page has PHP
session_start();
$_SESSION['sessTotal'] = $_POST['txtTotal'];
and the payment page has
session_start(); at the top of the page and <?php echo $_SESSION['sessTotal']; ?> where I want the total to display. The total does not carry over to the payment page and I can't work out why.
Here is all the PHP from the form page as I'm pretty new to PHP and not sure if there's a conflict (should session_start appear more than once?) Thanks guys
<?php require_once('Connections/df.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
$_SESSION['sessTotal'] = $_POST['txtTotal'];
// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);
$logoutGoTo = "index.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
?>
<?php
if (!isset($_SESSION)) {
session_start();
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
if (($strUsers == "") && true) {
$isValid = true;
return $isValid;
$MM_restrictGoTo = "index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$colname_userDets = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_userDets = $_SESSION['MM_Username'];
mysql_select_db($database_df, $df);
$query_userDets = sprintf("SELECT usersId, userName, password, name FROM users WHERE userName = %s", GetSQLValueString($colname_userDets, "text"));
$userDets = mysql_query($query_userDets, $df) or die(mysql_error());
$row_userDets = mysql_fetch_assoc($userDets);
$totalRows_userDets = mysql_num_rows($userDets);
?>OK I got it. I needed
session_start();
$_SESSION['sessTotal'] = $_POST['txtTotal'];
on the payments page as well, not just session_start(); -
I have developed a system and it had been used for 6 month
already, it started had problem last week, user can log in system ,
but after they click the each menu tab, the system give message
"please login system" because the session variable is lost.
I tried to debug the file and find that the session.userID is
there in the file where I set it, but it become empty in other
page.
The weird thing is that it did not happen to everyone, most
of user don't have problem, only a few user login and the session
variable is lost after they move from login page to different page,
when I did cfdump to output all session varibale, I found that
seesionid changed from page to page for those user who had problem,
the user who had problem now did not had problem before and I did
not change any code, I tried the internet setting which still did
not fix problem.
I am wondering whether it is related to cold fusion server
setting.
Please give some advice.A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.<br />
The helpers at that forum are more knowledgeable about web development issues.<br />
You need to register at the mozillaZine forum site in order to post at that forum.<br />
See http://forums.mozillazine.org/viewforum.php?f=25 -
Code to set and destroy session variables in Java Server Pages(JSP)
code to set and destroy session variables in Java Server Pages(JSP)
we have use following statement to set session variable
session.setAttribute("userClient",id);
we have use following statement to destroy session variable
session.setAttribute("userClient","");
and
the session.invalidate() is not working
Plz. solve this probemcode to set and destroy session variables in Java
Server Pages(JSP)
we have use following statement to set session
variable
session.setAttribute("userClient",id);
we have use following statement to destroy session
variable
session.setAttribute("userClient","");Perhaps if you tried using
session.setAttribute("userClient", null);
or
session.removeAttribute("userClient");
and
the session.invalidate() is not workingNot working how?
>
Plz. solve this probem -
Unable to fetch session variables in my application page code behind
hi,
my env: 1 WFE server which hosts the central admin and my web appln, 1 sql server box
i am having a custom web part[ listviewbyquery web part] which populates the site collection/ sub site's document library contents . also it reads some query string values and pushes these values into session variables.
and i am having another application page in this application which reads this session variables and perform some operation in a custom sql db. But i am unable to read these session variables on page load of this application page.
am unable to debug also. so, would like to know is there any way i can see, what values are getting passed to this page and verify the session variables are accessed correctly.
or
is this by design, that its not possible to read session variables in the application page ?
if i am not having a visual studio env. to debug, how to test these session variable existence / to find the root cause of this issue.
note: already configured session state in IIS , http modules section. am using Page.Session["myvariable1"].tostring() to fetch the session variables.
help is appreciated!i have found out myself. i have put page.response.write(mysessionvariables) in the code and deployed and tested in my env. and i was able to find out the reason and i have fixed it with proper validation check.
-
Session variables being lost in IE7
has anyone else experienced, heard of, or solved this issue?
I have a web app thats been running fine for 5+ years and using session variables (i'm currently using CF8).
When a user goes from page to page the session is carried with them so i know their login info. However, recently some users (and not all) have complained that after logging in fine (meaning the sessions variables are created) and go to another page off of the main one only to get a timeout issue. I've compared everything from IE settings to server settings, etc. but found no differences. It's like once they navigate to another page in the app the sessions are not carried to the next page.
My timeout code is written so that if the session variables that are created at login are not present the message will show.
Some users had to revert back to IE6 and it worked fine. Is there something they did wrong with ther IE update or is there some sort of server hot fix for this?
Hope someone can help... i'm baffled.That forum you posted is definitely my issue! However it still is unresolved and the users have yet to pinpoint the cause (just like me). I too firmly believe its due to an IE7 upgrade b/c that is when this happens.
I've checked out the user cookies. I used this script and put it on my server and had the user try it:
http://www.bennadel.com/blog/730-Testing-ColdFusion-Session-Cookie-Acceptance.htm
The cookies are passing over to the next pages fine (this script showed a success on the user machines). But ye the sessions are lost in my app. the CFID and CFTOKEN are changing when the user clicks to go to another page after login.
In fact I have the CF8 server monitor up and running and when someone logs in I can see the their session info under the MEMORY USAGE --> Sessions by memory usage.
I'm finding that users with this issue can log in fine but the session never gets registered with the server?!? Their CFID and CFTOKEN is not showing as an active session and when they click to another page their CFID is always different than their original?
Any thoughts? -
Coldfusion session variables being lost
ok so when my users login I establish session variables. one of these is employee id. in my Application.cfc I have this at the top:
<cfscript>
this.name = "My App";
this.sessiontimeout=CreateTimeSpan("0", "0", "45", "0");
this.SESSIONMANAGEMENT="YES";
this.SetClientCookies = "true";
this.setDomainCookies = "true";
</cfscript>
i also set the timeout for sessions at 45 in the CFadmin too.
after a successfull login i capture their session.employeenumber by authenticating through our corporate LDAP. no problem there. note: this app has run smoothly for 6+ years now but something has recently gone wrong.
on every page i reference a file in my application directory called "check_session.cfm" like this:
<cfmodule template="/myApp/Tags/check_session.cfm">
In that file I have code that checks for the existence of the session.employee_number. if it doesn't exist they either timed out or book-marked a page in the app in which they need to be logged in to view:
<cflock timeout="30" throwontimeout="Yes" type="READONLY" scope="SESSION">
<!--- Checks to make sure the user has a session--->
<CFIF NOT IsDefined("Session.employee_number")>
<CFLOCATION URL="http://#cgi.HTTP_HOST#/myApp/LoginAgain.cfm">
</CFIF>
</cflock>
every now and then (i'd say on average 5 times per week) i get an error message from a user (i re-direct all errors to my email with diagnostic info). the error reads "Element EMPLOYEE_NUMBER is undefined in SESSION". when i look at the page the error came from i see my call to the check_session.cfm file about 50 lines above where this error happened when i tried to reference session.employee_number. why wouldn't it not find it and re-direct the user to the timeout page? i can never duplicate this error on my machine either... i always get the right result without the error message. its a random, sporadic, intermittent error.Here is the diagnostic error information. Where you see [omitted] i've changed the URL for the purposes of displaying this detail in a public forum:
struct
Browser
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E; MS-RTC LM 8)
DateTime
{ts '2011-02-21 20:59:21'}
Diagnostics
Element EMPLOYEENUMBER is undefined in SESSION. <br>The error occurred on line 162.
GeneratedContent
<!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"> <!-- DW6 --> <head> <!-- Copyright 2005 Macromedia, Inc. All rights reserved. --> <title>My Home</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="mm_training.css" type="text/css" /> <link rel="stylesheet" type="text/css" href="../template/organized.css"> </head> <body bgcolor="#ffffff" onLoad="onInit()">
HTTPReferer
http://[omitted]/mypage/myhome.cfm?CFID=101686&CFTOKEN=53097237
Mailto
[empty string]
Message
Element EMPLOYEENUMBER is undefined in SESSION.
QueryString
[empty string]
RemoteAddress
10.x.x.x [remote address omitted for purposes of this forum]
RootCause
struct
Detail
[empty string]
ErrNumber
0
Message
Element EMPLOYEENUMBER is undefined in SESSION.
Resolvedname
SESSION
StackTrace
coldfusion.runtime.UndefinedElementException: Element EMPLOYEENUMBER is undefined in SESSION. at coldfusion.runtime.CfJspPage.resolveCanonicalName(CfJspPage.java:1659) at coldfusion.runtime.CfJspPage._resolve(CfJspPage.java:1612) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1747) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1740) at cfmyhome2ecfm1641837815._factor14(D:\[path_omitted]\mypage\myhome.cfm:162) at cfmyhome2ecfm1641837815.runPage(D:\[path_omitted]\mypage\myhome.cfm:1) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:273) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:86) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.CfmServlet.service(CfmServlet.java:175) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 ) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
TagContext
array
1
struct
COLUMN
0
ID
LINE
162
RAW_TRACE
at cfmyhome2ecfm1641837815._factor14(D:\[path_omitted]\mypage\myhome.cfm:162)
TEMPLATE
D:\[path_omitted]\mypage\myhome.cfm
TYPE
CFML
2
struct
COLUMN
0
ID
CF_MYHOME
LINE
1
RAW_TRACE
at cfmyhome2ecfm1641837815.runPage(D:\[path_omitted]\mypage\myhome.cfm:1)
TEMPLATE
D:\[path_omitted]\mypage\myhome.cfm
TYPE
CFML
Type
Expression
element
EMPLOYEENUMBER
objectType
object of java.lang.Class
Class Name
java.lang.Class
Methods
Method
Return Type
asSubclass(java.lang.Class)
java.lang.Class
cast(java.lang.Object)
java.lang.Object
desiredAssertionStatus()
boolean
forName(java.lang.String, boolean, java.lang.ClassLoader)
java.lang.Class
forName(java.lang.String)
java.lang.Class
getAnnotation(java.lang.Class)
java.lang.annotation.Annotation
getAnnotations()
java.lang.annotation.Annotation[]
getCanonicalName()
java.lang.String
getClassLoader()
java.lang.ClassLoader
getClasses()
java.lang.Class[]
getComponentType()
java.lang.Class
getConstructor(java.lang.Class[])
java.lang.reflect.Constructor
getConstructors()
java.lang.reflect.Constructor[]
getDeclaredAnnotations()
java.lang.annotation.Annotation[]
getDeclaredClasses()
java.lang.Class[]
getDeclaredConstructor(java.lang.Class[])
java.lang.reflect.Constructor
getDeclaredConstructors()
java.lang.reflect.Constructor[]
getDeclaredField(java.lang.String)
java.lang.reflect.Field
getDeclaredFields()
java.lang.reflect.Field[]
getDeclaredMethod(java.lang.String, java.lang.Class[])
java.lang.reflect.Method
getDeclaredMethods()
java.lang.reflect.Method[]
getDeclaringClass()
java.lang.Class
getEnclosingClass()
java.lang.Class
getEnclosingConstructor()
java.lang.reflect.Constructor
getEnclosingMethod()
java.lang.reflect.Method
getEnumConstants()
java.lang.Object[]
getField(java.lang.String)
java.lang.reflect.Field
getFields()
java.lang.reflect.Field[]
getGenericInterfaces()
java.lang.reflect.Type[]
getGenericSuperclass()
java.lang.reflect.Type
getInterfaces()
java.lang.Class[]
getMethod(java.lang.String, java.lang.Class[])
java.lang.reflect.Method
getMethods()
java.lang.reflect.Method[]
getModifiers()
int
getName()
java.lang.String
getPackage()
java.lang.Package
getProtectionDomain()
java.security.ProtectionDomain
getResource(java.lang.String)
java.net.URL
getResourceAsStream(java.lang.String)
java.io.InputStream
getSigners()
java.lang.Object[]
getSimpleName()
java.lang.String
getSuperclass()
java.lang.Class
getTypeParameters()
java.lang.reflect.TypeVariable[]
isAnnotation()
boolean
isAnnotationPresent(java.lang.Class)
boolean
isAnonymousClass()
boolean
isArray()
boolean
isAssignableFrom(java.lang.Class)
boolean
isEnum()
boolean
isInstance(java.lang.Object)
boolean
isInterface()
boolean
isLocalClass()
boolean
isMemberClass()
boolean
isPrimitive()
boolean
isSynthetic()
boolean
newInstance()
java.lang.Object
toString()
java.lang.String
StackTrace
coldfusion.runtime.UndefinedElementException: Element EMPLOYEENUMBER is undefined in SESSION. at coldfusion.runtime.CfJspPage.resolveCanonicalName(CfJspPage.java:1659) at coldfusion.runtime.CfJspPage._resolve(CfJspPage.java:1612) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1747) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1740) at cfmyhome2ecfm1641837815._factor14(D:\[path_omitted]\mypage\myhome.cfm:162) at cfmyhome2ecfm1641837815.runPage(D:\[path_omitted]\mypage\myhome.cfm:1) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:273) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:86) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.CfmServlet.service(CfmServlet.java:175) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 ) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
TagContext
array
1
struct
COLUMN
0
ID
LINE
162
RAW_TRACE
at cfmyhome2ecfm1641837815._factor14(D:\[path_omitted]\mypage\myhome.cfm:162)
TEMPLATE
D:\[path_omitted]\mypage\myhome.cfm
TYPE
CFML
2
struct
COLUMN
0
ID
CF_MYHOME
LINE
1
RAW_TRACE
at cfmyhome2ecfm1641837815.runPage(D:\[path_omitted]\mypage\myhome.cfm:1)
TEMPLATE
D:\[path_omitted]\mypage\myhome.cfm
TYPE
CFML
Template
/[omitted]/mypage/myhome.cfm
Type
coldfusion.runtime.CfErrorWrapper -
In my onApplicationStart method (which should tell you I'm
using an Application.cfC, not cfM), I have a cfif loop that passes
a value to a custom tag and returns a form variable. I'm then
reassigning that variable to a session variable. In IE, this works
just fine; in Firefox, though, the session variable is NOT being
set.
What might be causing this, and is there a workaround?The issue referred to an external CF custom tag, which called
another demo application to set a testing user. However, after
further testing, I realize that demo app won't function properly
with this application, so I've removed it.
Authentication is being set by an LDAP query; this
application that I am working on is going to be a sub-application
of a larger application, and the authenticated user is being set as
a session variable as well (I think...). However, I'm creating a
new session variable for this application, and simply passing the
authenticated user into my app (the outer app uses the variable
auth_user; I'm using the variable authuser, so there is no name
conflict).
Again, it is IE that is not persisting the session. Firefox
is doing so. I have looked in the advanced settings for IE, and
there is nothing about persisting session variables to check or
uncheck. Also, this application will probably be used mostly by
users using IE 6 with default settings, so I'm going to need to
find a workaround for IE.
Your help is most appreciated. -
Session is being lost between GET and POST
My application is being developed in Tomcat 4.1.18.
I have a servlet that acts as a Controller and JSP's that make up the View. Basically, the session gets lost in the following manner:
The application's web.xml file is set with Authentication method of Unspecified. Basically, it's not a high security application, we just need to make sure that the user maintains a session throughout the application.
User is presented with a page (login.jsp). They present their credentials. The controller does an include (RequestDispatcher.include) on a jsp (this jsp simply does a setProperty *) to fill the bean. Then, the controller passes control (through RequestDispatcher.forward) to the Action servlet. The Action does some processing and forwards to the next destination. Next, the user clicks on a link (GET) (this causes the URL to be rewritten with the correct session ID). In this particular instance, the user is presented with a form to fill out. The user fills out the form and it POSTS to the controller. At this point, the controller attempts to access the session and it is lost!
Frustrating. Please feel free to email at [email protected] Thanks.I just tried encoding the FORM ACTION and no dice. I'm pretty new to JSP's so I'm wondering if its something stupid that I'm doing (or not). I've never had this problem using straight servlets before.
It would be hard for me to justify getting rid of the JSP's and going with a straight servlet solution.
I'm also wondering if my Authentication:Unspecified in the web.xml file has anything to do with my current troubles. -
Use of Session Variable in Dashboard Page XML
Hi All,
Can we use a Session variable in the Dashboard Page XML?
My Requirement is,
There are 1000+ users, each user will have access to same dashboard. But a different report in the same dashboard.
So we want to Save individual user reports in the location /users/LOGIN_NAME/Financials/ABC
and dynamically change the Dashboard Page XML, to accept Session Variable VALUEOF(NQ_SESSION.USER) in place of LOGIN_NAME.
So that for each user, they will see only their report.On the face of it, Session is ideal for this, however this is SharePoint and the obvious isn't always the best.
You'd need to do the calculation about memory usage and number of concurrent users to ensure it really is a viable option in Production.
If it isn't viable, or wouldn't scale to possible future usage what would you do? Then you need to ask if it's really necessary to move between pages? If the user needs to move through a dialog for example, that could be hosted on a single page which might
have different controls or sections made visible as the user progressed through the use case.
Passing data between pages in SharePoint is a lot more difficult than it should be. Sometimes it's best to stay put, and certainly safer than using Session if you're really not sure if Session will stop your solution from scaling.
Always remember, SharePoint might be hosted on ASP.NET but the design considerations are significantly different than if this were a pure ASP.NET application.
w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP -
What is session variables in BSP
Hi
I am using using IC Webclient. can anyone help me to findout the details about session varibales ?
Best Regards
Bhavishyahi,
Session variables is a handy way to define a persistent variable.The standard variables used in ColdFusion can be only transferred or sent to the next page before it is necessary to restate the variable. In some situations, you may want to define a variable that will apply to all the pages during a single session of the user. An example is when the pages a user sees are personalized to his or her specific needs. In such a case, session variables are defined and used.
Session variable persistent
A session variable is one of several types of variables that persist across multiple templates:
>Server variables - Accessible by all clients and applications on a single
>Application variables - Tied to a single application and accessible by multiple clients
>Client variables - Tied to a single client over multiple sessions
>Session variables - Exist for one client or browser during a single session
>Cookie variables
Session variables are designed to hold information that you seldom write but are read often.
Defining session variables
Session variables are normally defined in the Application template, but can be also defined on all applicable pages.
Application template
The standard method of using session variables is to define them in the application.cfm template, which is a special ColdFusion page that is processed before the other pages in a session. It usually should be in the session root directory.
CFAPPLICATION tag
To enable the use of session variables, as well as client and application management, you should use the CFAPPLICATION tag in the Application template. A typical tag would be:
<CFAPPLICATION NAME="Name"
SESSIONMANAGEMENT="Yes"
SESSIONTIMEOUT="#CreateTimeSpan(0, 0, 20, 0)#">
where:
>NAME is required to avoid problems if you have session variables tied to separate applications.
>SESSIONMANAGEMENT is required to enable the session variables.
>SESSIONTIMEOUT is optional and limits the time the variables will stay in memory (20 minutes in the example) Note that the default is 20 minutes, so you really may not need this unless you want to change that number.
Setting variables
After the CFAPPLICATION tag, you can set your session variables, using the CFSET tag. You must always refer to session variables with the prefix session. Thus, you could define a session variable, such as:
<CFSET session.name="#form.othername#">
Should lock variables
You should lock the session variables to avoid problems when several people are using the system at the same time. An example of this is:
<CFLOCK TIMEOUT="30" NAME="#session.sessionID#" TYPE="Exclusive">
<CFSET session.name="#form.othername#">
</CFLOCK>
Defined on applicable pages
A problem in using the Application.cfm template is that it is often difficult to change your session variables, once they have been set. An alternative is to use the CFAPPLICATION tag in each applicable page:
<CFAPPLICATION NAME="Name"
SESSIONMANAGEMENT="Yes">
You then can define the session variable in the first page, accessed:
<CFOUTPUT QUERY="return">
<CFSET session.ID="#ID#">
</CFOUTPUT>
This is a compromise between the standard method and defining the variable on each page.
Example of use
Suppose a user logged in to the site. His name could be sent through a form and entered in Application.cfm. Then the session will constantly refer to him by name.
Application.cfm
<CFAPPLICATION NAME="Name"
SESSIONMANAGEMENT="Yes">
<CFSET session.name="#form.othername#">
Start.cfm
<CFOUTPUT>
<H1>Hello #session.name#</H1>
</CFOUTPUT> -
Session varaible data lost!
Hi,
I have a situation where I have A servlet set with some session variables from here another page url is called which is resides in a different machine and server. Again when A servlet is called through a url from the 2nd machine , the original session data set in A servlet is lost?
Any idea how the session data in A servlet could be retained?From all that I could understand from your questions, there are two servlets running in two different machines. They can never obtain each others session data.
-
Session variable causing ADODB.Field error '800a0bcd'
i have a page that before the session variable was added,
would display the
text i required if the recordset was empty.
Now i have a session variable on the same page and if the
recordset is
empty, instead of showing the text i need displayed, i get
the following
error:
ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been
deleted. Requested
operation requires a current record.
/Help_Desk/verified.asp, line 31
If i remove the session variable code from the page, it works
fine.....why
the conflicts?
<%Session("last")
=(rsVerify.Fields.Item("c_last_name").Value)%>
<%Session("first")
=(rsVerify.Fields.Item("c_first_name").Value)%>
<html>
What im doing is verifying if a user exists in the database.
If they do
there name is stored in a session and used later on the
following pages. If
they do not exist, they are suppose to receive a message
indicating to call
our support center to update there name...
I dont understand why the addition of the above two lines
cause this errorHere is all the code on the page... please let me know if
there is something
incorrect.....
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/USD.asp" -->
<%
Dim rsVerify__varLname
rsVerify__varLname = "%"
If (Request.Querystring("last") <> "") Then
rsVerify__varLname = Request.Querystring("last")
End If
%>
<%
Dim rsVerify__varFname
rsVerify__varFname = "%"
If (Request.Querystring("first") <> "") Then
rsVerify__varFname = Request.Querystring("first")
End If
%>
<%
Dim rsVerify
Dim rsVerify_numRows
Set rsVerify = Server.CreateObject("ADODB.Recordset")
rsVerify.ActiveConnection = MM_USD_STRING
rsVerify.Source = "SELECT c_last_name, c_first_name,
c_middle_name,
c_email_addr FROM AHD.ctct WHERE c_last_name = '" +
Replace(rsVerify__varLname, "'", "''") + "' and c_first_name
= '" +
Replace(rsVerify__varFname, "'", "''") + "' and del = '0'"
rsVerify.CursorType = 0
rsVerify.CursorLocation = 2
rsVerify.LockType = 1
rsVerify.Open()
rsVerify_numRows = 0
%>
<%Session("last")
=(rsVerify.Fields.Item("c_last_name").Value)%>
<%Session("first")
=(rsVerify.Fields.Item("c_first_name").Value)%>
<html>
<head>
<title>Account Verification</title>
</head>
<body text="#000000" link="#0000FF" vlink="#0000FF"
alink="#0000FF"
leftmargin="0" topmargin="0">
<!--#include virtual="/inc/header.asp" -->
<br>
<br>
<% If Not rsVerify.EOF Or Not rsVerify.BOF Then %>
<table width="605" align="center">
<tr bgcolor="#9999FF">
<td><strong>USD Name:</strong></td>
<td><strong><%=(rsVerify.Fields.Item("c_last_name").Value)%>,
<%=(rsVerify.Fields.Item("c_first_name").Value)%></strong></td>
</tr>
<tr>
<td><strong>First
Name:</strong></td>
<td><strong><font
color="#FF0000"><%=(rsVerify.Fields.Item("c_first_name").Value)%></font></strong></td>
</tr>
<tr>
<td><strong>Last Name:</strong></td>
<td><strong><font
color="#FF0000"><%=(rsVerify.Fields.Item("c_last_name").Value)%></font></strong></td>
</tr>
<tr>
<td><strong>Email:</strong></td>
<td><strong><font
color="#FF0000"><%=(rsVerify.Fields.Item("c_email_addr").Value)%></font></strong></td>
</tr>
<tr>
<td><strong>Location:</strong></td>
<td><strong><font
color="#FF0000"><%=(rsVerify.Fields.Item("c_middle_name").Value)%></font></strong></td>
</tr>
<tr>
<td colspan="2"><div
align="center"><strong>If all 4 fields above
contain
your correct information please select from the links
below.<br>
If your are missing any information above please contact the
help
desk
before proceeding.</strong> </div></td>
</tr>
<tr>
<td colspan="2"><hr size="1"> <table
width="400" align="center">
<tr>
<td><div align="center"><strong><a
href="/Help_Desk/usd_stores1.asp">Open
Store / DC
Request</a></strong></div></td>
<td><div align="center"><strong><a
href="/Help_Desk/usd_corp1.asp">Open
Corporate
Request</a></strong></div></td>
</tr>
</table></td>
</tr>
</table>
<% End If ' end Not rsVerify.EOF Or NOT rsVerify.BOF %>
<br>
<div align="center">
<% If rsVerify.EOF And rsVerify.BOF Then %>
<table width="605">
<tr>
<td><div align="center"><font
color="#FF0000"><strong>If you are
receiving
this message, chances are you are not completely setup in
USD.<br>
Please contact the help desk to have your information
verified and
setup
if needed.</strong></font>
</div></td>
</tr>
</table>
<% End If ' end rsVerify.EOF And rsVerify.BOF %>
</div>
<div align="center"></div>
<!--#include virtual="/inc/footer.asp" -->
</body>
</html>
<%
rsVerify.Close()
Set rsVerify = Nothing
%>
"Daniel" <[email protected]> wrote in message
news:[email protected]...
>i have a page that before the session variable was added,
would display the
>text i required if the recordset was empty.
>
> Now i have a session variable on the same page and if
the recordset is
> empty, instead of showing the text i need displayed, i
get the following
> error:
>
> --------------------------
> ADODB.Field error '800a0bcd'
> Either BOF or EOF is True, or the current record has
been deleted.
> Requested operation requires a current record.
>
> /Help_Desk/verified.asp, line 31
> -----------------------------
>
> If i remove the session variable code from the page, it
works fine.....why
> the conflicts?
>
> <%Session("last")
=(rsVerify.Fields.Item("c_last_name").Value)%>
> <%Session("first")
=(rsVerify.Fields.Item("c_first_name").Value)%>
> <html>
>
> --------------
>
> What im doing is verifying if a user exists in the
database. If they do
> there name is stored in a session and used later on the
following pages.
> If they do not exist, they are suppose to receive a
message indicating to
> call our support center to update there name...
>
> I dont understand why the addition of the above two
lines cause this error
>
> -
Unable to filter a recordset using a session variable
I have a volunteer application page and when the volunteer presses <Submit> their info is saved in a MySQl db table and a session variable is created containing the primary key of their record in the table, control is then passed to a "success page". The success page can access the session variable (I proved this by displaying the session variable on the success page) so my next step was to create a recordset in the success page with a filter using the session variable to select the appropriate row in the table, allowing me to display to the volunteer the info they submitted.
I set up a test success page which displays the session variable and one field of the volunteer info. When I test this I see the session variable displayed but the corresponding volunteer info field from the recordset is not displayed.
The volunteer application page is here www.hollisterairshow.com/volunteerapp.php and the successpage is here www.hollisterairshow.com/thanksvol.php
The code that creates the session variable in the volunteer application page is shown below
$_SESSION['volunteer_id'] = mysql_insert_id();
The code to display the session variable in the success page is shown below
<?php echo $_SESSION['volunteer_id']; ?>
The code to display the volunteer info is shown below
<h1> Thank You <?php echo $row_rsVolunteerApp['firstname']; ?>!! </h1>
The recordset definition is shown below
The success page test result is shown below, as you can see the volunteer's first name is not displayed immediately after the "Thank you" message but the session variable holding the correct primary key (41) is shown correctly.
Does anyone have an idea of what I'm doing wrong?
Thanks
TonyWhere did you put session_start()? It needs to be before the variable is accessed. It's obviously before the line that displays the value in your page, but is it before the SQL query is generated?
Also, have you checked in phpMyAdmin to see whether volunteernumber 41 has any values in the database?
Maybe you are looking for
-
HOW TO TURN A .FLV FILE INTO AN SWF IN ADOBE?
Questions,,,,, 1. In a flash slide,,,,,How do I add effects to the movie, like an intro black curtain coming up from the top and closing down on the bottom,,,,,,to make it look more professional?,,,,,,,,,,,like this video-SUMMER NIGHTS- http://music.
-
Regarding DocumentBuilder.parse method returns reference as null value.
Hi We are in the process of migrating code which works on WebSphere/JBOSS to WLS.. We are using DocumentBuilder object for parsing the Locale related xml data. I understand that the DocumentBuilder is provided by DocumentBuilderFactory which is an in
-
No Videout via Firewire or my AJA IO LA
Hi, i just don`t get any videoout over my aja IO La. In FCP there is no broblem. But in color i see the selectable Formats for Firewire and AJA io, but i can´t select them. Video out is really inportant for Color correction. so , how i get this done.
-
Hi, Could you please help out how to create AUTHORITY OBJECT and usage in reports with sample code and transaction codes. Thanks, Madhu
-
Help loading a binary tree from file
Hi all, So I am working on making a 20 question game using a binary tree. I have set it up so each time the user plays, if the computer cannot guess what they are thinking of, they tell the computer and it saves it. I am saving the tree in a text fil