session-variables

How to assign values from form to Javascript session variables

谁都会走 提交于 2019-12-24 23:26:03
问题 I am trying to create Javascript Session variables that will read information from one form and pass these variables to another form. I can assign strings to these Session variables but i cannot assign values from Form elements to these variables function SetUserName() { <% var text1= "Charles";%> <%Session["UserName"] =text1;%> var session_value='<%=Session["UserName"]%>'; } </script> This is the Javascript on the first page which works and on a button click i call another page where i can

Why does the value of session variable remain even after all the code of destruction?

喜你入骨 提交于 2019-12-24 21:02:19
问题 login.aspx if (IsPostBack == false) { //destroy any login information Session["password"] = "false"; Session["login"] = "false"; Session.Abandon(); Session.RemoveAll(); } if (TextBox2.Text == main_password) {//then he is website server admin Session["password"] = "password"; Session["login"] = "true"; Response.Redirect("~/TABLE.aspx"); } table.aspx //checking if website server admin if ("password" == (string)Session["password"]) { link_logout.Enabled = true; }//if ends else {//not authorized

ASP.NET Connection String

眉间皱痕 提交于 2019-12-24 18:36:00
问题 I am having some trouble with one of my ASP.NET 2.0 application's connection string. There are instances that I would get a ConnectionString Property Has not Been Initialized problem which occurs randomly and intermittently and without any reason. My Connection string is actually coming from a webservice, because different kinds of users are provided with different sets of connection string depending on their user level. What I have done so far goes like this: I have a master page ( mstr.page

Preventing multiple getter invoke in a session managed bean?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 17:27:26
问题 i'm using jsf 2.0.2 + richfaces 3.3.3. what can i do so my getter won't be invoked multiple time ?? i have this: @ManagedBean(name = "mybean") @SessionScoped public class mybean implements Serializable { public MyClass getMyClass() { if (FacesContext.getCurrentInstance().getRenderResponse()) { myClass = get_it_from_database(); } return myClass; } i also used this: @ManagedBean(name = "mybean") @SessionScoped public class mybean implements Serializable { public MyClass getMyClass() { if

PHP session sometimes is lost when using session_regenerate_id

拥有回忆 提交于 2019-12-24 15:39:12
问题 I have strange behavior in my website, when session is started with the following option: session_regenerate_id(true); Sometimes when browsing, user gets kicked from members area, I get errors that session variables are undefined at that moment, for example: [Tue Oct 29 13:37:39 2013] [error] [client 78.62.xx.xx] PHP Notice: Undefined variable: origid in /home/rolandas/public_html/domain.com/members/send_sms.php on line 115, referer: http://www.domain.com/members/actions.php But if I do not

Session variable empty after page reload

試著忘記壹切 提交于 2019-12-24 13:26:34
问题 Only one of my many session variables on the cart page of my e-commerce application is getting destroyed somehow. When i add the product to the cart along with a session id, it creates an order_id(using some hash and salt logic) and puts it in session variable and when i go to the cart page it queries the DB based on both order_id and session id to fetch the products in the cart. For the first time it fetches the records, but immediately after it if i reload the page it gets an empty order_id

Session variables in Google Chrome persist after browser closes

泄露秘密 提交于 2019-12-24 13:17:44
问题 I'm using session variable to store some data. I want the data to be lost when the browser closes, or session times out. Everything works in IE and FF, but chrome persists session variables after browser has been closed. var myName = Session["Name"]; if (myName == null) { myName = "defaultName"; } It will not fall into the if block if i close and re-open chrome, as the session variable is persisted. Is there a way to ensure session variables are lost after google's chrome is closed ? 回答1:

Why I lose my session variable?

余生长醉 提交于 2019-12-24 11:53:57
问题 I´m on MVC and using KnockoputJS. I select the value from 2 select. In the first select i choose IDCompany, and the second select i choose IDSubsidiary. I send the model in Json to JsonResult in the controller and I create a variable session and a cookie and save IDCompany in the Session variable and in the cookie with the same name. I do the same with IDSubsidiary. Finally, I return to the ajax function (which call "Save" at first) [HttpPost] public JsonResult Save(ViewModel viewModel) {

need more detail tying in Session_start() to a select statement

こ雲淡風輕ζ 提交于 2019-12-24 11:50:19
问题 Still banging my head, but I think an answer may help me see how things really work. I always sucked at languages, but I figure with your help I can brute force this. So I am just going to post the whole code so as not to cause confusion. <html> <head> <title>Change a player</title> </head> <BODY > <?php include "inc.php"; session_start(); print 'Select week for season: '; print $this_season; ##the week drop down query# $wquery= "select week_num,week_name from stats_week where season=$this

Why I lose my session variable?

大憨熊 提交于 2019-12-24 11:48:15
问题 I´m on MVC and using KnockoputJS. I select the value from 2 select. In the first select i choose IDCompany, and the second select i choose IDSubsidiary. I send the model in Json to JsonResult in the controller and I create a variable session and a cookie and save IDCompany in the Session variable and in the cookie with the same name. I do the same with IDSubsidiary. Finally, I return to the ajax function (which call "Save" at first) [HttpPost] public JsonResult Save(ViewModel viewModel) {