session-variables

Set Session variable using javascript

血红的双手。 提交于 2019-12-28 06:51:33
问题 <script type="text/javascript"> function checkQuery() { var val = form1.proDown.options[form1.proDown.options.selectedIndex].value; var txt = form1.proDown.options[form1.proDown.options.selectedIndex].text; //alert(val+' | '+txt); <?php $_SESSION['value1']= ?> = txt; <?php ; ?> } </script> I have this code and it does not Work? Any One have solution for accessing javascript variable into $_SESSION[]. 回答1: I think you should use xhr(Ajax) to store your data into php session. Following is a

PHP session variables not being maintaned

旧巷老猫 提交于 2019-12-28 04:27:08
问题 I have an application that has been working with session variables no problem. I start the session before the headers on every page that uses when, it has been fine then it seems all of a sudden I'm getting an undefined index error when I navigate to a page other than the one that sets up the session variables. But only on some browsers . Sometimes sessions are maintained and sometimes they aren't. It seems that cookies aren't being stored some of the time. I've done checks using different

Get current session variable without page refresh

核能气质少年 提交于 2019-12-25 18:57:56
问题 my problem is as follows (Question updated): I've got two pages: 1.php and 2.php I'm trying to get a PHP variable (in this very case, a SESSION variable) from 2.php to 1.php through an AJAX request. This is the script in 1.php jQuery('#refresh').click(function(e){ e.preventDefault(); jQuery.ajax({ type:'POST', url: '2.php', data: { sessionVar: '<?php $PHPvariable ?>' }, success:function(response){ alert(sessionVar); } }) }); For your better understanding, this script is called from within the

$_SESSION seems to retain only last value

允我心安 提交于 2019-12-25 18:55:11
问题 Please see the test page here https://wintoweb.com/sandbox/question_3.php I use $_SESSION to store results of DB searches but only the last value is stored in the session. Looks like the latter is emptied upon each search. I've used session before on that server and had no problems. My code is probably faulty but I cannot figure it out. session_start is called at top of file. <?php if(isset($_GET['search'])){ } else if(isset($_GET['display_this'])){ $rets = getNames(); //The $rets will hold

$_SESSION seems to retain only last value

这一生的挚爱 提交于 2019-12-25 18:54:10
问题 Please see the test page here https://wintoweb.com/sandbox/question_3.php I use $_SESSION to store results of DB searches but only the last value is stored in the session. Looks like the latter is emptied upon each search. I've used session before on that server and had no problems. My code is probably faulty but I cannot figure it out. session_start is called at top of file. <?php if(isset($_GET['search'])){ } else if(isset($_GET['display_this'])){ $rets = getNames(); //The $rets will hold

Why can't I access symfony session variables from other files?

倖福魔咒の 提交于 2019-12-25 14:00:14
问题 I have an web app built with symfony framework. I want to merge an symfony app and an codeigniter app without creating a new application using only one framework. So if the user is loged in in symfony it will also be loged in codeigniter Now i am just trying to access session variables of this symfony app from another php file, but the $_SESSION varible is empty. (When I print it in this new file, when I print it in symfony files 'controllers, or views' printing it shows session variables

using static Dictionary instead of session asp.net mvc

白昼怎懂夜的黑 提交于 2019-12-25 08:48:37
问题 i have serialization problem with session(as i described here) so i used static Dictionary instead of session asp.net mvc public static Dictionary<string, object> FlightDict; FlightDict.Add("I_ShoppingClient", client); in this case user will override their values?are there any problem with that because they says with static variable users data can be overrided 回答1: Yes, you can change the static variables in the site, But You need to use this to change the data but that is not enough you need

PHP Display single value from session array

ぐ巨炮叔叔 提交于 2019-12-25 08:38:42
问题 I currently have a PHP form for our partners to register quotes. After the user log in they are brought to the beginning of the quote form. I would like the user's first name to display in the first form field automatically. The user's session information includes an array of values; one of which is the firstName value. This is the value that I would like to display in the first field when the user logs in. When I try to load the page I am getting an error instead of the user's first name.

how do i remove the security risk, due to cached version of page

♀尐吖头ヾ 提交于 2019-12-25 08:37:45
问题 please refer to the link why does the value of session variable remain even after all the code of destruction? in the above the problem is that login function made by me fails, as the browser is displaying the cached version of the page, which also I DO NOT KNOW WHY is capable of performing all the functions for a certain time limit, after which it REALIZES THAT ITS CACHED!! so, how to remove the cached version of the website, OR how to tell DO NOT MAKE MY COPY IN CACHE!!! by using c# 回答1:

Passing a parameter from AJAX to JSP page

浪子不回头ぞ 提交于 2019-12-25 08:09:13
问题 I am trying to pass a parameter from AJAX back to my JSP page. Here is my sample code: JS File: $(document).ready(function() { $.ajax({ type: "GET", url: "URL...", dataType: "xml", success: function(xml) { $(xml).find('Rowsets').each(function(){ var x = $(this).find('Auto_Id').text() // Assign data from Auto_Id into variable x document.form.y.value = x; // Pass the parameter back to the JSP page }); } }); }); .JSP File: <FORM name="form"><input name="y" value="" /></FORM> //value left blank