session-variables

Session variables lost between pages [duplicate]

安稳与你 提交于 2019-11-27 04:47:30
问题 This question already has answers here : PHP session lost after redirect (34 answers) Closed 3 years ago . In a page, two variables are passed in a URL. In the second page, these variables are initialized. At submit, new page open. The problem is here, I can't recover the session variables. The script indicate a error (undefined index). Thanks for help in advance. Here the code : First page : <?php $requete_cours="SELECT COURS.SIGLE AS SIGLE, ANNEE FROM COURS, MODULE WHERE COURS.ID_MODULE =

How can I get the value of a session variable inside a static method?

☆樱花仙子☆ 提交于 2019-11-27 03:48:30
I am using ASP.NET page methods with jQuery.... How do I get the value of a session variable inside a static method in C#? protected void Page_Load(object sender, EventArgs e) { Session["UserName"] = "Pandiya"; } [WebMethod] public static string GetName() { string s = Session["UserName"].ToString(); return s; } When I compile this I get the error: An object reference is required for the non-static field, method, or property 'System.Web.UI.Page.Session.get'` jwwishart HttpContext.Current.Session["..."] HttpContext.Current gets you the current ... well, Http Context; from which you can access:

Session variables are not persisting between page loads

断了今生、忘了曾经 提交于 2019-11-27 03:47:42
问题 Can someone tell me why the session vars are not passing between pages? They were working up to 2 days ago. Now its not? There is a third party system that logs users in based on the third party system. I direct users to the login page with the return url. The third party system logs a user in and passes their id and a token generated on their end and returns them to my site with the id and the token in the url. If sessions are not set i try and grab the id and the token from the url and set

Why HttpContext.Current.Session is null in Global.asax?

两盒软妹~` 提交于 2019-11-27 03:15:10
问题 I'm using VS2010 and created a simple asp. web forms application, using Development Server to test it. I try to store user data - queried from sql server - in the session, since I don't want to access database in every request. I'm using the 'Application_AuthenticateRequest' and the 'Session_Start' methods. First round: AuthenticateRequest called. The following code ran: public static void Initialize(string login_name, bool force_refresh) { HttpSessionState Session = HttpContext.Current

Accessing session attributes in Thymeleaf templates

痴心易碎 提交于 2019-11-27 02:52:28
问题 I would like to know whether is it possile to retrieve the session object and access its attributes from a Thymeleaf template without any controller code. 回答1: In Thymeleaf, session object can be easily accessed in a template: with a session variable: ${session.foo} // Retrieves the session atttribute 'foo' ${session.size()} ${session.isEmpty()} ${session.containsKey('foo')} with a #ctx object: ${#ctx.httpSession} Look at the Thymeleaf documentation for accessing different context objects:

Sharing SESSION Variables Between Multiple Subdomains

一个人想着一个人 提交于 2019-11-27 01:46:40
I have a website www.example.com. That will have multiple subdomains that work with a single application or program. For an example, login.example.com will allow the user to log in to the site while system.example.com will allow the user to access an information system, while forums.example.com will allow the user to access forums. We may need to pass information between the subdomains such as a user id, or a user preference, etc. How do we go about passing information between the sudomains using SESSION variables? EDIT: I like this idea: As the first thing in your script: ini_set('session

Rails 3 additional session configuration options (key, expires_after, secure)

不打扰是莪最后的温柔 提交于 2019-11-27 00:59:25
问题 Can someone point out what the new Rails 3.x session configuration options are? I'm trying to duplicate the same configuration that I have in my Rails 2.3.x application. This is the configuration that I used in the application: #environment.rb config.action_controller.session_store = :active_record_store config.action_controller.session = { :key => '_something', #non-secure for development :secret => 'really long random string' } # production.rb - override environment.rb for production config

Saving data to session in JSF

冷暖自知 提交于 2019-11-27 00:23:50
问题 I am new to the world of J(2)EE and web app development but am quickly navigating my way around it and learning a lot. Every day is a fantastic voyage of new discovery for me. I am currently working on a project in which I am using Visual JSF Woodstock on Glassfish v2. I am pretty new to JSF also. There are times when I need to save some objects (say MyObject for instance) between requests. And from what I have read and understood so far, I need to be using sessions to save these objects

MySQL wait_timeout Variable - GLOBAL vs SESSION

别等时光非礼了梦想. 提交于 2019-11-27 00:10:04
问题 SHOW VARIABLES LIKE "%wait%" Result: 28800 SET @@GLOBAL.wait_timeout=300 SHOW GLOBAL VARIABLES LIKE "%wait%" Result: 300 SHOW SESSION VARIABLES LIKE "%wait%" Result:28800 I am confused by the results. Why does the last query give Result:28800 ? 回答1: Your session status are set once you start a session, and by default, take the current GLOBAL value. If you disconnected after you did SET @@GLOBAL.wait_timeout=300 , then subsequently reconnected, you'd see SHOW SESSION VARIABLES LIKE "%wait%";

Is there a best practice and recommended alternative to Session variables in MVC

两盒软妹~` 提交于 2019-11-27 00:06:04
问题 Okay, so first off before anyone attempts to make a determination that this is a "duplicate" question; I have reviewed most of the posts on SO regarding similar questions but even in combination of all that has been said I still am somewhat at a dilemma as to the definitive or maybe I should say unanimous agreement on this. I can however say that I have (based on the posts) conclusively determined that the answer is based on the scope of the requirement. But even with consideration of this,