session-variables

session_id() not getting session variables

大兔子大兔子 提交于 2020-03-05 05:31:33
问题 I have a homebrew CMS installed on two different web servers. Each maintain the same code. I have had a really annoying problem when I try passing $_SESSION variables between different domains. My CMS is on domain1.com. The website it is controlling is on domain2.com. My system passes all the session variables for the login information from domain1.com to domain2.com via a url link (domain1.com has a link like this: http://domain2.com?sessionId=1gh... )(sessionId is generated by session_id())

Can we access session scope variables directly in JSF xhtml files

倖福魔咒の 提交于 2020-02-20 08:26:10
问题 Hi I am working on a JSF project, I will like to access some session level variables onto my xhtml UI pages directly without using any managed bean. Just wanted to know if this is possible and if yes than how? Thanks 回答1: Yes its possible If the bean doesnot exits then put it in session first FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(key,object); And to use the bean on xhtml page use <h:outputText value="#{sessionScope.key}" /> 来源: https://stackoverflow.com

Unset all session variables with similar name

时间秒杀一切 提交于 2020-01-30 12:00:48
问题 I'm using some $_SESSION variables for filtering many query records that have a similar name (ex. $_SESSION['nameFilter'] or $_SESSION['cityFilter'] and so on). I'm using a link for resetting these filters, but I want to know if there is a way to unset all $_SESSION variables that have a name that is like: $_SESSION[(somewords)Filter] 回答1: Use foreach to enumerate the keys of $_SESSION[] , use substr() to get the last 6 characters of each key, use unset() to (what else?) unset it. As easy as:

grails session creation, on how to prevent it

天涯浪子 提交于 2020-01-30 11:33:28
问题 in the last line in the following bug report https://github.com/grails/grails-core/issues/5296 it is stated that; In an ideal world, it would be possible to turn off HttpSession creation for a whole Controller (all actions) and also turn them off for a particular set of actions. This is however, a quite old bugreport, so my question is: is this possible in an upcoming or todays version (1.3.7) of grails? If not, shouldn't it be? The reason i seek this kind of behavior is due to development of

How to delete data based on value in session variable

半腔热情 提交于 2020-01-30 06:28:07
问题 add.php(When user click add photo) <div class="col-lg-12"> <div class="form-group" id="image"> <label>Auction Image</label> <div action="uploadImages.php" class="dropzone" id="uploadImageForm"></div> <span class="help-block" id="image-error"></span> </div> </div> <script> $(function () { Dropzone.options.uploadImageForm = false; Dropzone.options.uploadImageForm = { paramName: "file", maxFilesize: 1, acceptedFiles: 'image/*', maxFiles: 5, dictDefaultMessage: '<img src="images/icon_images.svg"

PHP session side-effect warning with global variables as a source of data

随声附和 提交于 2020-01-26 09:47:09
问题 I'm trying to host a PHP web site that was given to me. I see this warning: Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 What does this mean? How

Session variables not saving on initial page load

瘦欲@ 提交于 2020-01-25 12:42:27
问题 I have an MVC application which sets some session variables based on internal static IP addresses. I have built an ApplicationController to override the OnActionExecuted sub in MVC for data that I need to use throughout my application. However, the code below, which is just a snippet of my code but is edited for my post, only partially works. On initial page load, the session variables aren't saved, but after a page refresh they are. The issue I have is that these need to be saved on the

Where does IIS store user created sessions?

时光毁灭记忆、已成空白 提交于 2020-01-25 01:01:53
问题 From this article http://www.codeproject.com/Articles/5892/Session-Management-in-ASP-NET i have understood that session is stored in a browser in cookie (lets just assume Cookieless=false) and how it is used for future communication to overcome stateless nature of the web.I have one doubt - Where are sessions created by code (e.g. Session["abc"]="test data") stored? Are they only stored on server or they are also stored in cookies(which is highly unlikely)?If they are stored on server,where

expire session when there is no activity in PHP

本小妞迷上赌 提交于 2020-01-24 07:42:21
问题 I found many tutorials on Internet when you expire a session after a certain limit, like after 30 minutes or so, But I want to expire a session when there is no activity, quoting from a famous SO question the solution is straight forward: if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 1800)) { // last request was more than 30 minutes ago session_unset(); // unset $_SESSION variable for the run-time session_destroy(); // destroy session data in storage } $

How to prevent multiple logins from same user?

我是研究僧i 提交于 2020-01-24 00:57:31
问题 How can I prevent a logged-In member from logging into their account (in a new tab or different device) without logging out of their existing session ? I am working on a client job-board website where logged-in employers can submit a single Job Vacancy via the post_job.php page. The problem is they can Login again from a new tab or device without logging out and post more than their permitted single job posting. What would be the easiest way of preventing employers from doing this ? I am a