Removing session variables
Hello,
iwould like to preserve sessionvariables from an HttpSession while eliminating all other session values intact regardless of what page i am on. since the pages will have different values, i would want to grab all values and keep only the same list of values every time.
thanx for help
Vi
and do a session.invalidate(), this simply kills the
session and destroys all the session variables
contained in it, plus creates a new session. Thenmine doesn't seem to create a new session though... i get the following exception java.lang.IllegalStateException: setAttribute: Session already invalidated
my code invalidates the session and then tries to set new attributes... so a new session isn't automatically created... any ideas as to why? and for that how do i create a new session after it is invalidated?
HttpSession session = r.getSession(true);
session.invalidate();
session.setAttribute("Authenticated", "0");
session.setAttribute("Session", session.getId());
session.setMaxInactiveInterval(600);
Similar Messages
-
I created a period status session variable which i want to use as a filter in answers. This variable takes note of the last closed period (month - YYYYMDD) when the accounting team closes it in their books. I currently have open periods taking the values of the last closed period and so the client wants these open periods to be removed from the report until the period in closed with accounting hence the use of a filter on the period (month) column. I used this filter eg Time."Fiscal Period" <= VALUEOF(NQ_SESSION."CURR_PER_OPEN") but it is producing this message:
The specified criteria didn't result in any data. This is often caused by applying filters that are too restrictive or that contain incorrect values. Please check your Request Filters and try again. The filters currently being applied are shown below.Hi,
Try it like this..
Set the default using logical SQL. Select <presentation table>.<presentation
column> from <subject area> where
<presentation table>.<presentationation column> =
valueof(NQ_SESSION.<session variable>)
http://gerardnico.com/wiki/dat/obiee/set_request_variable_dashboard_prompt
http://sureshotstrategies.blogspot.com/2008/07/about-session-variables-in-obiee.html
Thanks
Deva -
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
>
> -
Displaying Session Variable on Dashboard & creating presentation variable
Hi.
I read a bit more on mysupport and it seems that :xdo_user_roles somehow displayes all kind of roles not the ones that the user acutally belongs to.
Now I wonder if I can use NQ_SESSION.GROUP in the BI Publisher data model.
(A)I figured that I can create a "list of values" in the data model and there I can select Oracle BI EE as a data source. maybe in the repository I can create a column that holds the nqsession_groups that I then use in the data model sql. assuming I can use a list of values in the sql.
(B) or I pass it as a parameter to the report/data modell just like a normal dropdownlist parameter (presentation variable)
Then I tried adding a text item on the dashboard with
@{biServer.variables[NQ_SESSION.USER.displayName]}
or
Session Variable My Year : @{biServer.VARIABLES['v_USER_GROUPS']} *
BUT none of them actually display any variables. :/
*this one I created in the repository and has the correct valuesWhen I remove "authenticated-role" from the BIConsumer Role in EM and visit my dashboard again I can see that the user is ONLY in role "AuthenticatedUser" now I wonder why this is the only one, I created a custom role in EM and added the user to that one but it does not show :/
-
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 -
I've been having this problem for a long time so I thought
I'd post again and maybe get a hit this time.
We run off windows cfmx 7.x now fully patched, prior to that
we were on cfmx 6.x. We use session management only. Many times on
a new page hit the user loses about half of their session variables
up to all of them. Typically we have them test on the same machine
using different browsers. 99% of the time switching from IE to
firefox solves the problem, most of the users have had IE 6.x.
I experienced this problem myself for about 4 months time and
I could reproduce it daily when neccessary by simply opening a new
window to our application and the session information would persist
to the new window but the parent window would receive a new cfid
and lose all session information. New windows aren't the only
issue, we see a lot of lost session variables in one click, same
window, functionality. I've had hooks in place to test if the
domain was different on page hits removing the www or something but
so far have not found anything there. Each time a new CFID is being
issued and they are losing the original. We attempted to put CFID's
in the URL at all times but that leads to other issues and didn't
solve the problem for us anyhow.
This has been a serious issue for awhile and browsing these
forums I see others are experiencing it to some extent too. I'm
wondiner if anyone has any tips or can confirm the CF Admin/app.cfc
setup you use if you're not seeing any problems like this.right... response.sendRedirect(). sendRedirect works by sending a repsonse to the browser with a location header. The browser sees that header and makes a new, separate request to the new location. It's no different then typing the location in the location bar in the browser or clicking a link.
But that doesn't matter. If you have 2 web applications (aka 2 servlet contexts) on the server, they are not going to share sessions between them. So the first page is working off one session in one context with some ID. Then the redirect sends it to another page in a different context. That session ID is not valid in that 2nd context, so a new session is created like it was a first time user. And if you redirect back, you may not get the same session for the first context, unless the session ID cookie defines the path as well (I'm not sure offhand).
The "application" object is the servlet context, specifically a javax.servlet.ServletContext object (or implementation of the interface, technically). Nothing is shared between contexts.
Now, you can always share things in one way or another. Store things in a database or in files. Use a messaging system like SOAP or JMS. Maybe the server allows for contexts to access each other (they aren't shared in that case, just that you can get a named context and read what's stored in it).
Or don't have your separate contexts, use subdirectories in the same context. -
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 variable and script error
Hello;
I am still writting this script that turns a bg sound on and
aff for the whole site to remember. I have a good start on this
code, but I am running into issues.
1. I am trying to use a checkbox to make the selection, and
when it is clicked, it will function without using a submit button,
the java script I am using isn't doing the job allowing the
checkbox to act as a link so to speak.
2. I need to make this script into a session variable. So
that when the decision is made, the site will remember it.
3. there might be a problem in my IF statement.
Can someone please help me out? I am attaching the code. It
is using a DB that has a yes/no box in the table this sound code is
accessing.
Thank you.
PhoenixA Quess...
Remove the OnClick in the form
<form onClick="category.submit();">
Place it in the input type?
<input type="checkbox"
onClick="category.submit();"> -
Server hangs and session variable value not maintained.
dear all,
this is exteremetly urgent. i upgraded my tomcat to 4.1.24.but i have problems running the same code which was working earlier, i get null in the value of session variable. and also get the following error
////////////////error got /////////////
Compile failed; see the compiler error output for details.
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:842)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:682)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:317)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext
.java:473)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:190)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
95)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
rValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:22
3)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:619)
at java.lang.Thread.run(Thread.java:536)
///////////////end of error messsge ////////////
the code where i am getting this message is as follows
<%@ page session="true"%>
<HTML>
<HEAD><TITLE> LOGGED IN ok</TITLE> </HEAD>
<%@ page import="java.sql.*" %>
<%! // declaring variables
String s = "";
java.sql.ResultSet rs=null;
java.sql.Connection con;
java.sql.Statement stmt=null,stmt1=null;
String username = "";
String password = "";
String Ousername = "";
String Opassword = "";
String changepass="";
String usertype ="",useremail="",EmpName="";
%>
<body>
<%
try
//set session for max of 100 milliseconds
// session.setMaxInactiveInterval(10000);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = java.sql.DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};" +"DBQ=c:/vishal/HelpDesk.mdb;DriverID=22;READONLY=false","","");
stmt = con.createStatement();
s = "select * from LoginUser";
username = request.getParameter("LogonId"); //get this through prev. form
password = request.getParameter("txtPassword");
out.println(username + " " + password);
// make explicitly to lower case
username = username.toLowerCase();
rs = stmt.executeQuery(s);
while(rs.next())
//getting data from database
Ousername = rs.getString("EmpName");
Opassword = rs.getString("Password");
useremail = rs.getString("EmailId");
usertype = rs.getString("UserType");
if(Opassword.equals(password) && Ousername.equals(username)) //found match correct entry
changepass = request.getParameter("PasswordNew");
if(changepass != null)
stmt1 = con.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,java.sql.ResultSet.CONCUR_UPDATABLE);
s = "update LoginUser set Password = '" + changepass + "' where EmpName = '" + username +"'";
out.println(s);
stmt1.executeUpdate(s);
stmt1.close();
if(usertype.equals("User") == false)//ie admin
session.setAttribute("username",username);
************************this value not maintained *********************
session.setAttribute("useremail",useremail);
session.setAttribute("usertype",usertype);
************************this value not maintained *********************
//closing connections
%>
<jsp:forward page= "ComplaintType.jsp" />
<%
else //user
EmpName = username;
session.setAttribute("EmpName",EmpName);
session.setAttribute("useremail",useremail);
//closing connections
%>
<jsp:forward page="ComplaintCategory.jsp" />
<%
}//end if
}//while loop
//first closing connections then forwarding
%>
<jsp:forward page="InvalidLOGIN.jsp" />
<%
///rs.close();
////closing
//stmt.close();
// con.close();
}//try
catch(Exception ep)
out.println(ep);
System.exit(1);
%>
</BODY>
</HTML>hi all,
thanx a lot for your help,specially hari52
hari52 strangely enough the code started working,but
now i have another problem
after a while my server hangs or gets shutdown ,a
message is shown as
"java.exe has generated error and will be shutdown"
i know that more connections can be a prob. but i
make sure that connections r closed on each page,also
i am a newbie and do not have the time at present to
learn abt. connection pool ,can this problem be
solved easily?
it would be a great help again on your part,
thanx again,You remove the System.exit(1) line from the code inside the catch block
and try again. That's the reason tomcat getting down. System.exit(1) should not be used inside jsp. it will make the underlaying Servlet Engine to shutdown. -
Hi i have requirement like this i would like to display the Ename, empno, Hiredate, leavedate,salary. Here i would like to pass the session variable for the salary column which returns multiple values and the report should change based on the date i am selecting from the prompt.
EX: Let's say from the prompt if select hiredate this date should pass into the report and the session should change.
I have created session intiallization block and for the target i have selected row wise.
select 'var1', salary from emp where hiredate<='VALUEOF(NQ_SESSION.var1)' .
But in the answers when i passed this 'var1' for the salary column it says no value for the 'var1'. please let me know how to pass session variable when we have selected the target as row-wise.
Thank you,
ch.Finally got population of the WEBGROUPS variable work (using row-wise initialization with caching turned off)...
but now I see that if I remove a group from my table, they are not "unassociated" with the web catalog group. The group still "sticks" there.
Thoughts?
-John -
Session Variables Won't Persist
Hello all, I'm writing an app for work where a user logs in
to a system and then adds and removes entries from a database
through a web app. I use session variables to store both the user's
login ID and that user's permissions. I get through the login just
fine. After clicking on a link on the following page though ( an "a
href=" link) the session variables are not available to the
following page. I don't understand why the session variables aren't
persisting throughout the site. In my application.cfm I have
<cfapplication name="App" sessionmanagement="true"
sessiontimeout="#CreateTimeSpan(0, 1, 0, 0)#"> Any help with
this would be greatly appreciated.Ah good. That's precisely what I was touching on when I asked
you:
- Are you accessing the same site with different domains, or
sub-domains? Ex: www.mysite.com, www2.mysite.com
Changing domains, and/or how you address the site itself will
always throw a curve-ball to your session vars. Session vars seem
to be related to two things:
1) The site's "domain" address (servername, www.mysite.com,
www2.mysite.com, localhost, etc)
2) The application "name" (see "name" attribute of your
cfapplication tag)
If either of the above two things change, you *can* lose your
session.
If you wanted to have a session persist across different
domains however, it is important to note that you CAN in fact do
that. You simply need to manually pass the CFID and CFTOKEN in the
URL at the exact point you cross from one domain to another.
(Assuming of course that both domains point to the same CF
application on the same server or cluster, and using the same
application "name")
The CF-server will detect those CFID and CFTOKEN vars in the
URL, and pull the correct session that you had from the previous
domain. Once you're "in" the second domain, you no longer need to
pass these tokens via the URL. However, if you wanted to cross BACK
to the original domain, you should once again pass those CFID and
CFTOKEN vars in the URL at the exact point you switch domains.
Anyways, I'm glad you worked it out. I wanted to add this
additional bit of explanation in case anyone else is reading, or
someone stumbles across this a year from now. -
Dreamweaver need to create a session variable or Cookie or something Help
I have been working for weeks I am very close but can't get over one last hurdle. I am trying to call a session variable much like dreamweaver calls mm_username. It is in the same user table as username - password - access level - Customer_id. I need to pull the session variable or cookie or however I can do it to access the customer id number so I can have customer specific information and pricing. There will be mulitple users for each customer so I need another variable besides mm_username. Help I use dreamweaver cs4 aspvbscript and sqlserver ...help
I soon as I put the red line of code in it is custoemr _id instead of user id in my table. Dreamweaver removes the user id function. is it in the wrong place ...what am i doning wrong ....it is fine with the first part you did but the second part it doesnt like in red.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include virtual="/Connections/p21.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername = CStr(Request.Form("username"))
If MM_valUsername <> "" Then
Dim MM_fldUserAuthorization
Dim MM_redirectLoginSuccess
Dim MM_redirectLoginFailed
Dim MM_loginSQL
Dim MM_rsUser
Dim MM_rsUser_cmd
MM_fldUserAuthorization = "Access_Level"
MM_redirectLoginSuccess = "/mainmenu.asp"
MM_redirectLoginFailed = "/loginfailed.asp"
MM_loginSQL = "SELECT customer_id, Login_Name, password"
If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
MM_loginSQL = MM_loginSQL & " FROM dbo.btb_web_login WHERE Login_Name = ? AND password = ?"
Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
MM_rsUser_cmd.ActiveConnection = MM_p21_STRING
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 20, MM_valUsername) ' adVarChar
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 10, Request.Form("password")) ' adVarChar
MM_rsUser_cmd.Prepared = true
Set MM_rsUser = MM_rsUser_cmd.Execute
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
Session ("MM_USERID") = MM_rsUser.Fields.Item("customer_id").value
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%><!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>Brown Live Online Login</title>
<style type="text/css">
<!--
body {
background-image: url(/images/gradientblacktowhite.jpg);
background-repeat: repeat-x;
.style1 {
color: #FFFFFF;
font-weight: bold;
.style3 {color: #000000; font-weight: bold; }
.style5 {
font-size: xx-large;
color: #0000FF;
.style6 {color: #000000}
-->
</style></head>
<body>
<p class="style5"><img src="/images/BTBlogosmall.jpg" width="322" height="53" /></p>
<p class="style5">Brown Live Online 2.0 </p>
<form ACTION="<%=MM_LoginAction%>" id="form1" name="form1" method="POST">
<p>
<label><span class="style3"> User Name</span>
<input name="username" type="text" id="username" size="20" />
</label>
</p>
<p>
<label><span class="style1"><span class="style6">Password</span></span>
<input name="password" type="password" id="password" size="20" />
</label>
</p>
<p>
<label>
<input type="submit" name="button" id="button" value="Login" />
</label>
</p>
</form>
<p><a href="/index.html"><img src="/images/brown2.0.jpg" width="100" height="100" /></a> Click Image to return to <a href="http://www.browntransmission.com">www.browntransmission.com</a></p>
</body>
</html> -
Flash Menus cause my session variables to drop or not show temporarily until I refresh the page
I have a login routine that once a user logs into teh site it
creates a session variable. I have used this same script many times
without any problem but I now have Flash menus and it seems that
after logining in (session created) I will click on a menu item and
the debugging shows that the session variable isn't there. If I hit
the REFRESH button on the browser it appears.
Has anyone gotten this and know a way to get around it. I
have 5 pages I need for a user to navigate to after loging in but
the initial load doesn't seem to have the session set even though
it was set when they logged in but a REFRESH of each page
individually now has the variable.
Any Ideas...Is this something with Flash menus or
something?Problem is solved by removing these 2 lines from iframe.html
if(navigator.appName=="Microsoft Internet Explorer")
document.location.replace(""); -
To pass new session variable value to stored proc before running a report.
Hi,
Below is summary of the report requirement -
Database level design
1. Created a view and a global temporary table (GTT)
2. Created an Oracle package procedure to accept from and to business dates on basis of which it will fetch, process and populate the GTT.
Repository level design
1. Created a business model containing the view and the GTT (mentioned above)
2. Created two SESSION variables "from_dt" and "to_dt" to be initialized by their respective init blocks. Each of the variable is initialized with a DATE column value (of type DATETIME) from a database lookup table. I have also set the option "Enable that variable to be set by any user" for both variables.
Query for these variables :
from_dt = select from_date from <table>
to_dt = select add_months(from_date,12) from <table>
Presentation level design
1. Using a text box, i display the default/initialized values of these variables like this -
Current business date:@{biServer.variables['NQ_SESSION.from_dt']} Future business dt:@{biServer.variables['NQ_SESSION.to_dt']}
Dates get displayed in YYYY-MM-DD 00:00:00 format
The text msg displays these default dates and allows the user to specift different date range for which i create prompts as shown below.
2. Using any random two columns of date type from the business model, i create two date dashboard prompts with labels "From Dt" and "To Dt".
i select Calender Controls for both; setting Default To = Report Defaults.
The Set Variable is set to Presentation variables - such that pv_from_dt maps to "From Dt" and pv_to_dt maps to "To Dt".
3. i create the report using the business model created above. In the report "Advanced Tab" => "Prefix" field i specify the following -
SET VARIABLE from_dt='@{pv_from_dt}',to_dt='@{pv_to_dt}';
Note : The logic here is to display the default dates and allow user to specify different date values which will be stored in presentation variables.
If the user does specify different "from dt" and "to dt" values, then using the presentation variables, i want to "write" back these new values to the corresponding session variables mentioned above.
If the user does not specify different date range, then the default/initialized dates must be considered.
I also display the default and new date values in the report title.
Back to Repository level design
To execute the stored procedure that will load the GTT before running the report I need to pass two date parameters to the stored procedure on basis of which it will fetch data, process and populate the GTT.
In the Connection Pool --> Connection Script Tab --> Execute before query, I wrote the below query using the repository variables FROM_DT and TO_DT to execute the procedure -
DECLARE
v_from_dt date;
v_to_dt date;
BEGIN
v_from_dt := VALUEOF(From_Dt);
v_to_dt := VALUEOF(To_Dt);
package_name1.package_body(v_from_dt,v_to_dt);
END;
Now when i try to run the report i get the following error :
[nQSError: 10058] A general error has occurred. [nQSError: 23006] The session variable, NQ_SESSION.to_dt, has no value definition. (HY000)..
Need help on this.
Is it possible to "write back" a new value to a session variable ?
Any other alternatives.
Thanks
Nusrat
Edited by: user10309945 on Jan 24, 2011 10:08 PMSandeep, I found a several topics where users describe saving values in DB through stored procedure or function. For example, [How to store OBIEE presentation level variable values in DB |http://forums.oracle.com/forums/thread.jspa?threadID=892006] I tried it and get an error
*10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 14551, message: ORA-14551: cannot perform a DML operation inside a query ORA-06512*
It's not a BI error. This error are generated by Oracle DB. If I write next:
SELECT MyPLSQLFunction(p1,p2) FROM DUAL
I get the same error.
Oracle doesn't allow DML operations in SELECT.
Did you relalize this feature yourself? Where did I mistake? -
Session variable size limitation (LV Webservices)
Hi community,
I read couple dozen email addresses from an XML and trying to write them into a session variable. The email addresses are comma separated and have a total string length of about 1100 characters. When I try to write it into a session variable LabVIEW drops an error message (-67158).
It is very clearly related to the size of the string as if use lets say only 200 characters I dont receive the error message.
How can I get rid of this limitation?
Thanks!I am writing a general purpose webpage where I need email notifications. I have the workaround ready (before I send out the emails I dont read the emails from a session, but using the userID stored in the session to read the email from the xml). But generally having this limitation is annoying and unnecessary as normally you easily can store 100kB in one session. (probably even more, but that was the max I have ever did)
Maybe you are looking for
-
XMLELEMENT/ XMLAGG functions - Fetching the result into a variable
Hi, I have a query to generate an XML output. I have the following questions: 1) I am typecasting the result from this query to a VARCHAR2 and I want to assign the output to a VARCHAR2 variable. Can you please help me with that. When I try to get thi
-
Required a BAPI for Knocking-off customer items using F-32
Hi... Can any one let me know, Is there any BAPI to post the customer cleared items from J2EE to SAP. Or Is it correct to create BDC for resolving the above issue. Regards, Swathi.
-
i created test report from solution manager, when i try to run macro "SAP_CREATE_TESTREPORT" it gives error: "Unexpected value for encoding type: 50" i am using MS Word 2010, Solution Manager 7.0 EHP1 Please help Edited by: Hasan Sidra on Nov 22, 20
-
Not enough Memory to export?
When doing a lot of work on an image using more than one too l ie adjustment brush, spot removal and then exporting as a jpeg, it doesnt always export due to 'not enough memory' but also if successfully exported, once opened in Adobe and changes made
-
If your iCloud freezes when open system preferences, please do the following
If your iCloud freezes when open system preferences, please do the following. (What i mean is the following, Settings>iCloud then it will freeze before you entering email, then follow the steps below) turn off your iPhone. log out from iCloud, in any