Filtering recordset with session variable

This has never happened to me before, but for some reason, my
recordset that drives a dynamic table won't filter results based on
a session variable. I know session variables are working because I
have the session variable echo on the page (dragged-n-dropped my
session variable from the Bindings panel to my page), and that
works fine. So why can't I filter my recordset with the same
session variable??? What's going on?
PS: I've attached my result page's code to this
message.

Actually, problem solved. I moved " session_start()" above
"$colname_rsSales = "-1" ", which did the trick.

Similar Messages

  • Filtering a Recordset with session variable

    Hi
    I am trying to filter a recordset based on a session
    variable. The session variable is passed from the login page via a
    username which is their email address. This has been successful.
    However when I want to filter the users table - tbl_users to
    show their first name it doesn't work.
    I followed the adobe help tutorial plus ahave tried other
    combinations and I am now at a loss on where exactly I am going
    wrong.
    The recordset is rs_UserAccess
    I have a session variable called - MM_Username
    The table has 5 records of various users
    The code that I have fiddling with is -
    <%
    Dim rs_UserAccess
    Dim rs_UserAccess_numRows
    Set rs_UserAccess = Server.CreateObject("ADODB.Recordset")
    rs_UserAccess.ActiveConnection = MM_conn_sidecounter_STRING
    rs_UserAccess.Source = "SELECT * FROM tbl_users WHERE
    username = MM_Username"
    rs_UserAccess.CursorType = 0
    rs_UserAccess.CursorLocation = 2
    rs_UserAccess.LockType = 1
    rs_UserAccess.Open()
    rs_UserAccess_numRows = 0
    %>
    Any help would be appreciated. I have outlined below the
    different combinations I have tested.
    Try No1
    rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE username
    = Session("MM_Username")”
    Message:
    Microsoft VBScript compilation error '800a0401'
    Expected end of statement
    /main.asp, line 182
    Try No2
    rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE username
    = Session(‘MM_Username’)”
    Message:
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [Microsoft][ODBC Microsoft Access Driver] Undefined function
    'Session' in expression.
    /main.asp, line 186
    Try No3
    rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE username
    = Session(MM_Username)”
    Message:
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [Microsoft][ODBC Microsoft Access Driver] Undefined function
    'Session' in expression.
    /main.asp, line 186
    Try No4
    rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE username
    = Session Variable MM_Username"
    Message:
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [Microsoft][ODBC Microsoft Access Driver] Syntax error
    (missing operator) in query expression 'username = Session Variable
    MM_Username'.
    /main.asp, line 186
    Try No5
    rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE username
    = MM_Username"
    Message:
    Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
    [Microsoft][ODBC Microsoft Access Driver] Too few parameters.
    Expected 1.
    /main.asp, line 186
    Thanks in advance
    Cheers
    Downsy

    Try this:
    rs_UserAccess.Source = "SELECT * FROM tbl_users WHERE
    username = " & Session("MM_Username")
    Keep that on one line.
    Ken Ford
    Adobe Community Expert
    Fordwebs, LLC
    http://www.fordwebs.com
    "Downsy42" <[email protected]> wrote in
    message news:[email protected]...
    > Hi
    > I am trying to filter a recordset based on a session
    variable. The session
    > variable is passed from the login page via a username
    which is their email
    > address. This has been successful.
    > However when I want to filter the users table -
    tbl_users to show their first
    > name it doesn't work.
    > I followed the adobe help tutorial plus ahave tried
    other combinations and I
    > am now at a loss on where exactly I am going wrong.
    > The recordset is rs_UserAccess
    > I have a session variable called - MM_Username
    > The table has 5 records of various users
    >
    > The code that I have fiddling with is -
    >
    > <%
    > Dim rs_UserAccess
    > Dim rs_UserAccess_numRows
    >
    > Set rs_UserAccess =
    Server.CreateObject("ADODB.Recordset")
    > rs_UserAccess.ActiveConnection =
    MM_conn_sidecounter_STRING
    > rs_UserAccess.Source = "SELECT * FROM tbl_users WHERE
    username = MM_Username"
    > rs_UserAccess.CursorType = 0
    > rs_UserAccess.CursorLocation = 2
    > rs_UserAccess.LockType = 1
    > rs_UserAccess.Open()
    >
    > rs_UserAccess_numRows = 0
    > %>
    >
    >
    >
    > Any help would be appreciated. I have outlined below the
    different
    > combinations I have tested.
    >
    >
    > Try No1
    > rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE
    username =
    > Session("MM_Username")?
    > Message:
    > Microsoft VBScript compilation error '800a0401'
    > Expected end of statement
    > /main.asp, line 182
    >
    > Try No2
    > rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE
    username =
    > Session(?MM_Username?)?
    > Message:
    > Microsoft OLE DB Provider for ODBC Drivers error
    '80040e14'
    > [Microsoft][ODBC Microsoft Access Driver] Undefined
    function 'Session' in
    > expression.
    > /main.asp, line 186
    >
    > Try No3
    > rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE
    username =
    > Session(MM_Username)?
    > Message:
    > Microsoft OLE DB Provider for ODBC Drivers error
    '80040e14'
    > [Microsoft][ODBC Microsoft Access Driver] Undefined
    function 'Session' in
    > expression.
    > /main.asp, line 186
    >
    > Try No4
    > rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE
    username = Session
    > Variable MM_Username"
    > Message:
    > Microsoft OLE DB Provider for ODBC Drivers error
    '80040e14'
    > [Microsoft][ODBC Microsoft Access Driver] Syntax error
    (missing operator) in
    > query expression 'username = Session Variable
    MM_Username'.
    > /main.asp, line 186
    >
    > Try No5
    > rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE
    username = MM_Username"
    > Message:
    > Microsoft OLE DB Provider for ODBC Drivers error
    '80040e10'
    > [Microsoft][ODBC Microsoft Access Driver] Too few
    parameters. Expected 1.
    > /main.asp, line 186
    >
    > Thanks in advance
    > Cheers
    > Downsy
    >
    >
    >

  • Filter recordset with session variable

    This has never happened to me before, but for some reason, my
    recordset that drives a dynamic table won't filter results based on
    a session variable. I know session variables are working because I
    have the session variable echo on the page (dragged-n-dropped my
    session variable from the Bindings panel to my page), and that
    works fine. So why can't I filter my recordset with the same
    session variable??? What's going on?
    PS: I've attached my result page's code to this
    message.

    Gabe the Animator wrote:
    > <?php require_once('Connections/sales.php'); ?>
    > <?php
    > if (!function_exists("GetSQLValueString")) {
    > function GetSQLValueString($theValue, $theType,
    $theDefinedValue = "",
    > $theNotDefinedValue = "")
    > {
    > $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_rsSales = "-1";
    > if (isset($_SESSION['state'])) {
    > $colname_rsSales = $_SESSION['state'];
    > }
    > mysql_select_db($database_sales, $sales);
    > $query_rsSales = sprintf("SELECT * FROM sales WHERE city
    = %s",
    > GetSQLValueString($colname_rsSales, "text"));
    > $rsSales = mysql_query($query_rsSales, $sales) or
    die(mysql_error());
    > $row_rsSales = mysql_fetch_assoc($rsSales);
    > $totalRows_rsSales = mysql_num_rows($rsSales);
    >
    > session_start(); ?>
    The issue is that PHP doesn't "work" with session values
    until the session has started, and that must be done on each page,
    and must be done in the code *above* any reference to a session
    variable. The code you posted has the session_start() after it
    tries to use the session value ito filter the recordset. So move
    this last line of code ( session_start(); ) above $colnam_rsSales =
    "-1". Better yet, use:
    if(!session_id()){
    session_start();
    To prevent some versions of PHP from generating a
    warning/notice if you've called session_start() on the page already
    and you call it again.
    Danilo Celic
    | Extending Knowledge Daily :
    http://CommunityMX.com/
    | Adobe Community Expert

  • GO URL with Session Variable

    I want to use interaction between two reports in different dashboards, which do not share the same tables but the same values.
    When clicking on column A values in Report A, I want to create action link with option to open Report B, presenting column B, which is filtered by value A.
    I also want the prompts in Report B to present the value A, as it was selected by the user on Report A.
    I thought about using GOURL in action link to specific URL. I manage to open Report B, but it is not filtered by A.
    How can I transfer the value A in the URL? how should I add the value A into '&val1=XXX'?
    I also want to transfer other prompt values (e.g. val2 of col2) from A to B. I set this prompt value to session variable, but how can I add it in the GOURL syntax of '&val2=XXX'?

    Hi,
    Check those links might help you.
    Integrating Oracle OBIEE Content using GO URL
    How to set session variables using url variables | OBIEE Blog
    OBIEE 10G - How to set a request/session variable using the Saw Url (Go/Dashboard) | GerardNico.com (BI, OBIEE, O…
    Thanks,
    Satya

  • Help with session variable please - CS5.5 PHP

    Hi all,
    I am needing a little assistance with using a session variable and hope that someone may point me in the right direction.
    I have created a PHP page that uses the Dreamweaver 'User Authentication' feature, and the basics of this works fine, directing a user to the correct pages depending on whether they are or are not a valid user. I would like however to personalise the 'valid user' page with the persons Username as entered in the User Authentication table....a seemingly simple task using a session variable, but one that I just don't seem to be able to get working!
    The code generated for the UA on page 1 is as follows:
    <?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['txtfirst_name'])) {
      $loginUsername=$_POST['txtfirst_name'];
      $password=$_POST['txtsurname'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "member_update.php";
      $MM_redirectLoginFailed = "login.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_panto, $panto);
      $LoginRS__query=sprintf("SELECT firstname, surname FROM web_access WHERE firstname=%s AND surname=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $panto) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
        if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
        //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 );
    ?>
    Firstly, the text highlighted in red above appears to be setting the session variable that I require. Is This correct?
    If so, what is the code that I need to place in page 2 to use that session variable? or
    Do I need to do something else on page 1 to properly assign the session variable?
    Would really appreciate your expertise
    Mark

    It looks as though you've set the columns incorrectly in the User Authentication server behavior. This is the SQL query that checks the user's credentials:
      $LoginRS__query=sprintf("SELECT firstname, surname FROM web_access WHERE firstname=%s AND surname=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
    You're looking for firstname and surname, whereas you should be looking for the user's login name and password.
    $_SESSION['MM_Username'] is a session variable that stores the user's login name. To use it in a subsequent page, all that's needed is for the page to begin with session_start(). You can then echo the value to display it.
    If you want to display the person's real name, you need to create a recordset in the second page using $_SESSION['MM_Username'] to find the firstname and surname. Alternatively, you can edit the existing code like this (I've copied only part of it):
      $LoginRS__query=sprintf("SELECT firstname, surname FROM web_access WHERE firstname=%s AND password=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $panto) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
        $row = mysql_fetch_assoc($LoginRS);
         $_SESSION['full_name'] = $row['firstname'] . ' ' . $row['surname'];
        if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
        //declare two session variables and assign them
       $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;
    You can then use $_SESSION['full_name'] in a subsequent page that begins with session_start().

  • Alternate method to writing filter for recordset using session variable

    I'm not sure if this can be done.  I have a user page which I'd like to return database info based upon a userid entered on another page. So far, the session variable (userid) is captured on the user page however it is supposed to return the user's name rather than displaying the session variable.
    My problem is this. Within dreamweaver, I am able to create recordsets however I cannot create a filter. The connection works. At this point, I am searching for a workaround where I can tie in the session variable to recordsets. I should make mention that whenever I update the sql statement using the recordset widget, my recordset disappears. ?  At any rate, heres a sample of the code sans connection strings, etc.
    <%
    Dim Recordset1
    Dim Recordset1_cmd
    Dim Recordset1_numRows
    Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
    Recordset1_cmd.ActiveConnection = MM_newuniversity1_STRING
    Recordset1_cmd.CommandText = "SELECT name FROM table WHERE userid =  '" & Session("userid_my") & "'"
    Recordset1_cmd.Prepared = true
    Set Recordset1 = Recordset1_cmd.Execute
    Recordset1_numRows = 0
    %>
    On the user page, I have a 'Welcome' and the following code
    {Request.userid_my}
    Any suggestions? I'm afraid I'm a newbie to asp within dreamweaver cs3.

    >When I insert  request.userid_my code it returns the session variable
    AFAIK, session variables are not part of the request object - so I do not understand why you are referencing them this way. I would use the standard reference method : Welcome <%Response.Write(Session("username"))%>
    >when I insert the recordset associated with 'name' I get an Adobe End of file error. ?
    Sounds like a possible problem with your installation. You may need to try reinstalling DW. How are you "inserting" this recordset and when does the error occur?
    Regarding your next post...
    >select name from table_name where userid = '" & namemy & "'"
    >The statement consistently returns a 'quoted string not properly terminated' error.....
    The select statement you quoted is obviously not complete. If you are refering to the select in your OP:
    Recordset1_cmd.CommandText = "SELECT name FROM table WHERE userid =  '" & Session("userid_my") & "'"
    I see nothing wrong with that syntax and the string appears to be terminated correctly. If there is a different statement causing the error, please post the entire line and include a line above and below.

  • How do i filter recordsets using session variable???  Please help this is driving me mad...!!

    I am having the same problem as user "Gabe the animator" in a post sent in 2007.
    "my recordset that drives a dynamic table won't filter results based on a session variable. I know session variables are working because I have the session variable echo on the page (dragged-n-dropped my session variable from the Bindings panel to my page), and that works fine. So why can't I filter my recordset with the same session variable???"
    here is the code:
    <?php require_once('Connections/mockconn.php'); ?>
    <?php
    session_start();
    ?>
    <?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;
    if(!session_id()){
    session_start();
    $colname_info = "-1";
    if (isset($_SESSION['email'])) {
      $colname_info = $_SESSION['email'];
    mysql_select_db($database_mockconn, $mockconn);
    $query_info = sprintf("SELECT name, last_name, email, password FROM registration WHERE email = %s", GetSQLValueString($colname_info, "text"));
    $info = mysql_query($query_info, $mockconn) or die(mysql_error());
    $row_info = mysql_fetch_assoc($info);
    $totalRows_info = mysql_num_rows($info);
    ?>
    <!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>home</title>
    </head>
    <body>
    <div id="info">hello <?php echo $row_info['']; ?></div>
    <?php
    if (isset($_SESSION['email'])) {
              echo 'your email: '.' '. $_SESSION['email'] .' '.'good job';}
                        ?>
    </body>
    </html>
    PLEASE PLEASE HELP.... I have been at this for day's...
    how do I get the record set to filter based on the value of the session variable

    Sorry I forgot to mension the error I am getting?
    ( ! ) Notice: Undefined index: in C:\wamp\www\mock\home.php on line 59
    Call Stack
    Time
    Memory
    Function
    Location
    1
    0.0093
    389024
    {main}( )
    ..\home.php:0
    Why is this error coming up?

  • Issue with session variable

    Hi,
    I'm trying to setup a session variable to filter an Answer query based on the user login name. I've created the following
    - A database table that contains a user name and its related filter (Entity)
    - An initialization block for the session variable to issue the following sql: select Entity from table where user_name = ':USER'
    - Created a target session variable called CURR_ENTITY as the target and assign a default value as 'No entity'.
    - Filter my Answer query to use the session variable CURR_ENTITY
    After restart of BI server and Presentation services and opening the report, CURR_ENTITY is always set to the default value. I've checked NQQuery,.log and looks like the initialization block was not returning any rows.
    Any ideas on how to get around this issue? Thanks.
    Regards,
    Gerd

    Hi gerd,
    select Entity from table where user_name = ':USER'Check if this query is returning values in the backend DB.If so it is returning then it should work fine in session variable.
    After defining the target variable CURR_ENTITY and test it in the screen.That shows you is it picking all the values or a single defaulted value.
    If its showing all values then re-check your block once again.
    (OR)
    In the target variable instead of variable define row-wise initialization (i mean check it) and change the SQL in the variable to this
    select 'CURR_ENTITY',Entity from table where user_name = ':USER'
    and test it so you can use it in answers .....it should work with what is required.
    hope answered the question.
    Cheers,
    KK

  • Row level security with session variables, not a best practice?

    Hello,
    We are about to implement row level security in our BI project using OBIEE, and the solution we found most convenient for our requirement was to use session variables with initalization blocks.
    The problem is that this method is listed as a "non best practice" in the Oracle documentation.
    Alternative Security Administration Options - 11g Release 1 (11.1.1)
    (This appendix describes alternative security administration options included for backward compatibility with upgraded systems and are not considered a best practice.)
    Managing Session Variables
    System session variables obtain their values from initialization blocks and are used to authenticate Oracle Business Intelligence users against external sources such as LDAP servers or database tables. Every active BI Server session generates session variables and initializes them. Each session variable instance can be initialized to a different value. For more information about how session variable and initialization blocks are used by Oracle Business Intelligence, see "Using Variables in the Oracle BI Repository" in Oracle Fusion Middleware Metadata Repository Builder's Guide for Oracle Business Intelligence Enterprise Edition.
    How confusing... what is the best practice then?
    Thank you for your help.
    Joao Moreira

    authenticating / authorizing part is take care by weblogic and then USER variable initialized and you may use it for any initblocks for security.
    Init block for authenticating / authorizing and session variables are different, i guess you are mixing both.

  • Problem with Session variable initialization block

    Hi,
    I'm getting strange results when using session variables in my repository files.
    I have created session variables as specified in the document which is available at
    http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/bi_admin/biadmin.html
    The main problem getting with the system session variable (USER) in the select statement.
    My select statement is as follows,
    select ':USER',case when upper(':USER') = 'KUMAR' then 'APR-05' end from Dual
    The problem is while logging into the BI Answers it is allowing all the invalid users to login who does not exist.
    when i remove the quotes and simply use :USER in the select statement it is not allowing the invalid users to login but giving error while displaying the results.
    when i remove the user variable from select statement its giving correct results.
    Can i know what is causing the problem.
    Thanks,
    Kumar.

    Hi DK,
    Check out my post Rowlevel Security?? and see if it helps you.
    Cheers!
    -Joe

  • Problem with session variable

    Hi,
    After I insert a record into my MS Access database, it seems
    to me that the session variable got destroyed so the next page
    display the session variable as undefined. Has anyone have similar
    problem? If so, how to work around that?
    Thanks.
    Tommy,

    neptunes wrote:
    but its leading to jsp page error...For starters: never, never, ignore errors (exceptions and stacktraces). Those contain very, very, worthful information about the cause of the problem and what exactly went wrong. This way you can easily trackback the problem and solve it.
    If you're unable to think logically and smart so that you can interpret the error yourself, if necessary with help of Google, then post it here. Then we'll tell you about the actual problem and possible soltions.
    At any way:
    iam displaying some data in a table using resultset object,now at the same time iam using to session variable to use the resultset object in my other applications...This already doesn't sound very good. You should never pass expensive resources around like that. You should acquire and close the Connection, (Prepared)Statement and ResultSet in the shortest possible scope. Preferably already in the same method as where you query the data.

  • Purchased ColdFusion 10: Having problem with session variables

    My Dept. has just bought CF10 and I'm finally updating my existing web app to CF10 from CF8. My First Problem with CF10 is using session variables.
    When using the lower version of CF (since CF 4 to 8) I have never had any problem setting up session variables and getting or using these variables in other pages after a successful login but with CF 10 it seems setting session variables and using them in other pages are a major problems. I'm not sure where have I done wrong in the codes.
    First I'm setting the session in my Application.cfc This way:
    <cfcomponent displayname="Application" output="true">
      <cfset THIS.Name ="MyNewApp"/>
      <cfset THIS.ApplicationTimeout = CreateTimeSpan(0,0,20,0) />
      <cfset THIS.SessionManagement ="YES"/>
      <cfset THIS.SessionTimeout = CreateTimeSpan( 0, 0, 20, 0 ) />
      <cfset THIS.SetClientCookies = false />
    <cffunction name="OnApplicationStart" access="public" returntype="boolean" output="false">
    <cfset application.Main_DSN = "TESTDB">
    <cfreturn true />
    </cffunction>
    <cffunction name="onApplicationEnd" output="false">
          <cfargument name="applicationScope" required="true">
        </cffunction>
    <cffunction name="OnSessionStart" access="public" returntype="void" output="false" hint="Fires when user session initializes.">
    <cfset session.loggedin = "NO">
    <cfset session.username = "">
    <cfset session.userrights = "">
    <cfset session.usergroup = "">
    </cffunction>
    </cfcomponent>
    After login, user is validated and set values to those session.variables:
    ........user validation codes here......................
    <cfif mylogin NEQ true>
          <cflocation url="/login/login.cfm">
          <cfabort
    <cfelse>
          <cfset session.loggedin="Yes">
          <cfset session.username="#Trim(Form.username)#">
         <CFSET qUserRights = LoginObj.getUserRights('#Trim(Form.username)#')>
         <cfset session.userrights = qUserRights><!--- it's a query --->
        <CFSET qUserGroup = LoginObj.getUserGroup('#Trim(Form.username)#')>
            <cfloop query="qUserGroup">
               <cfset session.usergroup = user_group>
               <cfbreak>
            </cfloop>
        <!--- ****************** ???????????????????????????????????????????????????????????????????????????
        When I do cfdump in at this level, I can see that all of these session variables have been assigned to their values.
        But these session variables are not accessible from other pages. Other pages still show these session variable without its value.
        So, when I use these cfdumps in the index.cfm it is shown as they're not yet assigned with any values   ****************** --->
       <cfdump var="#session.loggedin#">
       <cfdump var="#session.username#">
       <cfdump var="#session.userright#">
       <cfdump var="#session.usergroup#">
    </cfif>
    In index.cfm, Before Login I got:
    session.loggedin = NO
    session.username = ["empty string"]
    session.userrights = ["empty string"]
    session.usergroup = ["empty string"]
    After a successful Login:
    session.loggedin = NO
    session.username = ["empty string"]
    session.userrights = ["empty string"]
    session.usergroup = ["empty string"]
    Have I done something wrong? These codes work on CF8. Please help.
    I need to mentioned:
    CF10 is in Linux and my web app is under https not http. But these session variables should be shared bentween http and https because some older application are still in http.

    On which page is the following code?
    After login, user is validated and set values to those session.variables:
    ........user validation codes here......................
    <cfif mylogin NEQ true>
          <cflocation url="/login/login.cfm">
          <cfabort
    <cfelse>
          <cfset session.loggedin="Yes">
          <cfset session.username="#Trim(Form.username)#">
         <CFSET qUserRights = LoginObj.getUserRights('#Trim(Form.username)#')>
         <cfset session.userrights = qUserRights><!--- it's a query --->
        <CFSET qUserGroup = LoginObj.getUserGroup('#Trim(Form.username)#')>
            <cfloop query="qUserGroup">
               <cfset session.usergroup = user_group>
               <cfbreak>
            </cfloop>
        <!--- ****************** ???????????????????????????????????????????????????????????????????????????
        When I do cfdump in at this level, I can see that all of these session variables have been assigned to their values.
        But these session variables are not accessible from other pages. Other pages still show these session variable without its value.
        So, when I use these cfdumps in the index.cfm it is shown as they're not yet assigned with any values   ****************** --->
       <cfdump var="#session.loggedin#">
       <cfdump var="#session.username#">
       <cfdump var="#session.userright#">
       <cfdump var="#session.usergroup#">
    </cfif>

  • 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 Dooly

    is 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.
              

  • ADDT Dynamic List with Session Variable?

    I've created a dynamic list using ADDT. When a member logs into the site I want the member to see only his or her specific information in this list. How do I create a session variable that allows only the logged in member to see there specific information in the list?
    <br />
    <br /><%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <br />
    <!--#include file="../Connections/rentalpaypro.asp" -->
    <br />
    <!--#include file="../includes/common/KT_common.asp" -->
    <br />
    <!--#include file="../includes/tfi/TFI.asp" -->
    <br />
    <!--#include file="../includes/tso/TSO.asp" -->
    <br />
    <!--#include file="../includes/nav/NAV.asp" -->
    <br /><%<br />' Filter<br />  Dim tfi_listLandLordRentalProperties3: Set tfi_listLandLordRentalProperties3 = new TFI_TableFilter<br />  tfi_listLandLordRentalProperties3.Init MM_rentalpaypro_STRING, "tfi_listLandLordRentalProperties3"<br />  tfi_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.memUserName", "STRING_TYPE", "memUserName", "%"<br />  tfi_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.StreeNumber", "NUMERIC_TYPE", "StreeNumber", "="<br />  tfi_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.StreetName", "STRING_TYPE", "StreetName", "%"<br />  tfi_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.AptNumber", "NUMERIC_TYPE", "AptNumber", "="<br />  tfi_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.City", "STRING_TYPE", "City", "%"<br />  tfi_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.State", "STRING_TYPE", "State", "%"<br />  tfi_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.ZipCode", "NUMERIC_TYPE", "ZipCode", "="<br />  tfi_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.RentAmount", "NUMERIC_TYPE", "RentAmount", "="<br />  tfi_listLandLordRentalProperties3.Execute()<br /><br />' Sorter<br />  Dim tso_listLandLordRentalProperties3: Set tso_listLandLordRentalProperties3 = new TSO_TableSorter<br />  tso_listLandLordRentalProperties3.Init "rslistLandLordRentalProperties3", "tso_listLandLordRentalProperties3"<br />  tso_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.memUserName"<br />  tso_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.StreeNumber"<br />  tso_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.StreetName"<br />  tso_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.AptNumber"<br />  tso_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.City"<br />  tso_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.State"<br />  tso_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.ZipCode"<br />  tso_listLandLordRentalProperties3.addColumn "LandLordRentalProperties.RentAmount"<br />  tso_listLandLordRentalProperties3.setDefault "LandLordRentalProperties.memUserName"<br />  tso_listLandLordRentalProperties3.Execute()<br /><br />' Navigation<br />  Dim nav_listLandLordRentalProperties3: Set nav_listLandLordRentalProperties3 = new NAV_Regular<br />  nav_listLandLordRentalProperties3.Init "nav_listLandLordRentalProperties3", "rsLandLordRentalProperties1", "../", Request.ServerVariables("URL"), 10<br />%>
    <br />

    Hi,
    when you use the dynamic list ..
    it creates a SQL query..
    change it ..,
    add the param ( your session variable to it)
    hope this helps
    regards
    mohnkhan
    http://www.mohitech.com

  • Need assistance with session variable

    Hello All, I am new to BIEE product. I have defined an initialization block - called it 'NQ_SESSION' and a session variable 'REVENUE'.
    Then, I created a sample report in Answers where I am attempting to use this variable. At report level, on a amount column I am adding a function
    "Sales Facts".AMOUNT/VALUEOF(NQ_SESSION.REVENUE)
    But the Answers does not return the correct value. Why? Thank you, Sonya

    Please give us more details :
    - what is the request of your init block ?
    - what are the returned results ?
    - can you copy the request generated by OBIEE ? (in the session logs)
    Other question : When you just display the value of the variable, do you have the right value ?

Maybe you are looking for

  • Hp S2331A monitor replacemen​t fault.

    I've previously had my monitor replaced with a reconditoned monitor already having 675 hours of backlit use.  I have tried calling the uk 0844 369 0369 helpine but the number is unavailable so am unable to get hold of a techinician.  The problems tha

  • Media Encoder stops encoding but doesn't stop running!

    What I mean by this is, I set up a bunch of files to begin encoding into various different forms, carefully check the settings and hit the go/run/play button and things kick off nicely. Using the Dynamic Link option to encode right out of Premiere Pr

  • Setting up and using a Mac Mini WITHOUT a screen

    I use an IMAC, a macBook 15" and an old G4 Powerbook 15". I have no external screen available and would prefer to avoid the purchase of an external screen. I am considering to purchase a mac mini to operate my large Itunes library and store my movies

  • How to trim the spaces at end of the line

    Hi, My requirement is to spool the data returned by query with column seperator as "|" . I am setting linesize before running the query and can't expect the exact linesize. There may be extra spaces also. Example: 2030588|EPM_NA_US_RMT_12295_________

  • How can I add the the field in the database in JSP?

    How can I add the the field in the MS access using JSP?