session-variables

INFO output despite “SET client_min_messages TO WARNING” just before

孤人 提交于 2019-12-01 04:46:30
postgresql-9.0.15 on CentOS 6.5. I have a plperlu function that outputs an INFO message. I want to suppress it during testing (using psql, which also behaves as below), but I can't even seem to do it from a pgAdminIII (1.18.1 for win2003) query window: SET client_min_messages TO WARNING; select my_info_outputting_function('lalala') I run that and look in the "messages" tab, and there's my INFO message. (This may appear similar to How to suppress INFO messages when running psql scripts , but I don't want to disable INFO messages for my whole session, just part of it and then set the minimum

asp.net values of Session variables in Session_End event

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 03:48:29
If I store a value in a session variable Session["Int"] = 100; What it will be in the Session_End event? Will it be null or 100? void Session_End(object sender, EventArgs e) { object objInt = Session["Int"]; // Null or 100 ? } Meaning, will Session_End fire after disposing everything in the session or just before? It is 100. To test it yourself simply add the ASP.NET application file global.asax to your project and handle the Session_Start end Session-End events: void Session_Start(object sender, EventArgs e) { Session["Int"] = 100; // 100 } void Session_End(object sender, EventArgs e) {

how to pass session variable to model in RoR?

♀尐吖头ヾ 提交于 2019-12-01 03:27:19
问题 I used a global variable in my app for passing information before. But I got a problem and thanks everyone here suggested me to store those data in session with database. I tried, but I found that I can't access the session variable in Model. I googled and knew this is the Model normal behavior, RoR won't pass the session variable to Model. So, I would like to use that session variable in validation and also the controller.... how to pass the value of the session variable into Models? or is

How to get Symfony session variable in model?

醉酒当歌 提交于 2019-12-01 01:16:56
How can I pass session variable in symfony model without using sfContext::getInstance() ? Maerlyn The recommended way is called dependency injection, and works like this: you create a setUser() method in your model file, that saves the given parameter to a private property: class Foo { private $_user; public function setUser(myUser $user) { $this->_user = $user; } // ... later: public function save(Doctrine_Connection $conn = null) { // use $this->_user to whatever you need } } This looks clumsy, because it is. But without you answering the question what are you trying to do? I cannot give an

asp.net values of Session variables in Session_End event

让人想犯罪 __ 提交于 2019-12-01 01:07:47
问题 If I store a value in a session variable Session["Int"] = 100; What it will be in the Session_End event? Will it be null or 100? void Session_End(object sender, EventArgs e) { object objInt = Session["Int"]; // Null or 100 ? } Meaning, will Session_End fire after disposing everything in the session or just before? 回答1: It is 100. To test it yourself simply add the ASP.NET application file global.asax to your project and handle the Session_Start end Session-End events: void Session_Start

How to get Symfony session variable in model?

∥☆過路亽.° 提交于 2019-11-30 20:55:25
问题 How can I pass session variable in symfony model without using sfContext::getInstance() ? 回答1: The recommended way is called dependency injection, and works like this: you create a setUser() method in your model file, that saves the given parameter to a private property: class Foo { private $_user; public function setUser(myUser $user) { $this->_user = $user; } // ... later: public function save(Doctrine_Connection $conn = null) { // use $this->_user to whatever you need } } This looks clumsy

PHP Multiple Concurrent Sessions Per User

烂漫一生 提交于 2019-11-30 17:29:38
I'm working on a web app using PHP on Apache. $_SESSION variables are used quite a bit for the information that must persist across pages. We need each user to be able to open multiple concurrent sessions, either as new tabs or new windows, depending on their choice of browser. Right now when a user opens an addition tab or window and goes to the site the existing session is adopted. How can I prevent this so that the user must (or may) log in and start a new session, without it interfering with any existing session(s) they already have open? Our temporary workaround is to use multiple

How do I save data on LocalStorage in Ruby on Rails 3.2.8?

人走茶凉 提交于 2019-11-30 14:30:29
I'm trying to save a variable called persistent_data . I usually use session[:persistent_data] or cookies[:persistent_data] , but I would like to use the localstorage instead. How do I do that on Rails? Localstorage has nothing to do with rails. You do it the same way as with any other language: <script> localStorage.setItem("company_id", "1"); </script> localStorage.getItem("company_id"); => 1 You can use rails to dynamically set the item however: <script> localStorage.setItem("company_id", "<%= @company.id %>"); </script> As far as I know localStorage has nothing to do with Rails, it is pure

accessing session variables in javascript inside jsp

笑着哭i 提交于 2019-11-30 14:09:00
问题 I need to provide data for google APIs table... so I'll send it from servlet to JSP but how can I access this data in "googles" javascript? I'll provide sample of another JS - very simple one - just to let me learn how to make what topic says <script> function showTable() { <% Object obj = session.getAttribute("list"); List<String> list = new ArrayList<String>(); int size = 0; if (obj != null) { list = (ArrayList<String>) obj; size = (Integer) session.getAttribute("size"); } for (int i = 0 ;

Where I should declare a session variable in asp.net

旧城冷巷雨未停 提交于 2019-11-30 13:56:48
I am building a Asp.net Application. I need to save a HashTable in a session. At page load i am writing protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Session["AttemptCount"]=new Hashtable(); //Because of this line. } } Here problem is, when a user refresh the page, session["AttemptCount"] also get refreshed. I want to know where should I declare Session["AttemptCount"]=new Hashtable(); So that my seesion do not get refeshed. EDIT In Global.asax, this session will get started, as soon as user opens the website. I want to creat this session only if user go to a