session-variables

Session is create and print in backend but not work in frontend

馋奶兔 提交于 2019-12-24 09:58:05
问题 I am facing some strange issue. This problem happens on server. I am facing this problem since last 5-6 days. It was working for me until last 1 year. When I call a login api, if user credential is right then I create a session. Here is my code: if ($user){ if ($user['is_active'] == 1){ global $user_data; $user_data = $user; $response["error"] = false; $_SESSION['user_data'] = $user; // -- session is create print_r($_SESSION); // session is print. $_SESSION['is_login'] = 'No'; unset($_SESSION

declaring a session dictionary in a master page

孤街浪徒 提交于 2019-12-24 09:13:54
问题 How do you declare a dictionary called MyDic in the master page? I want MyDic to hold lists of objects MyObj with a date as the key so that I can write something like this: "get the list for date 1/28/2011 from MyDic" or "put this list of MyObj from 1/28/2011 in MyDic". I'd like to declare the dictionary in the master page so that I can access it in every page. Thanks. 回答1: How were you planning on persisting the list? Instead of creating it in the master page, you could create it as an

How basic types get stored in asp.net session variable

这一生的挚爱 提交于 2019-12-24 08:35:55
问题 I need to know How basic types Int, enum, string get stored in session variable. Are they get serialized first before storing. 回答1: That depends entirely on how session state is configured. If you just store session state in-memory, serialization is not needed. The variables are stored straight into a dictionary object. If you store session state on a session state server or in the database, then the variables are indeed serialized and deserialized all the time. You can find out more at http:

Passing sessions variables through an iframe, php

此生再无相见时 提交于 2019-12-24 06:58:33
问题 First timer to the site, not an overly experienced php programmer here :) I have a problem, i am using an iframe within a site which im attempting to use a session variable inside, firstly ive just been trying to display the session variable to make sure they are accessible from within the iframe: echo "session of productcheck ".$_SESSION['productcheck']." "; echo "session of productcheck1 ".$_SESSION['productcheck1']." "; echo "session of productcheck2 ".$_SESSION['productcheck2']." "; echo

Confused by PHP session problem (Rackspace)

本小妞迷上赌 提交于 2019-12-24 02:50:22
问题 My PHP session fluctuates between different values for no apparent reason. here is my test code that proves it: <?php //test.php ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); session_start(); print_r($_SESSION); ?> When I refresh that test.php, the $_SESSION has different values (about 3 different arrays in total), as if I was browsing the site in between refreshing the page (I'm not). Echo'ing session_id() doesn't output anything. Any ideas? This is completely messing up my

php session not working after publish on web hosting

岁酱吖の 提交于 2019-12-24 02:42:38
问题 My website works fine on localhost, but once I deploy it to my hosting service, the session stops working. <?php session_start(); session_save_path('log/session.txt'); ini_set('session.gc_probability', 1); error_reporting(E_ALL ^ E_NOTICE); date_default_timezone_set("Asia/Jakarta"); require_once 'jadwal/calendar/tc_calendar.php'; include "../metode/data.php"; include "../metode/jalan.php"; include "../metode/perintah.php"; include "../metode/gambar.php"; //session $queryadmin = mysql_query(

How can I access Session vars from Base class in ASP.Net?

被刻印的时光 ゝ 提交于 2019-12-24 00:53:47
问题 I've run in to a this problem regarding Sessions in asp.net. I'm creating an ASP.Net web application. I've created a class called BasePage that inherits from System.Web.Ui.Page. This BasePage class is a System.Web.Ui.Page with an additional member called ActiveUser of type ActiveUser (a class I've created of my own). In the constructor of BasePage I set the member ui to this.ui = (ActiveUser)Session["ActiveUser"] , which is a session var that is previously set. However, when I run my project

How to pass encrypted data via browser (HTML5) session variable

£可爱£侵袭症+ 提交于 2019-12-24 00:07:20
问题 I am trying to pass encrypted data via a browser/client session variable - not to be confused with server-side session variable : encrypt: var encrypted_user_id = CryptoJS.AES.encrypt(user_id, cipher_pass); var encrypted_user_password = CryptoJS.AES.encrypt(password, cipher_pass); sessionStorage.setItem('user_id', encrypted_user_id); sessionStorage.setItem('user_password', encrypted_user_password); decrypt: var encrypted_user_id = sessionStorage.getItem('user_id'); var encrypted_user_password

MongoDB ObjectID safe for session id

牧云@^-^@ 提交于 2019-12-23 22:09:10
问题 I am making a session system for a Happstack server and I use mongoDB for persistent storage. I was wondering if the MongoDB ObjectIDs are safe for use as session IDs. 回答1: Generally speaking, MongoDB ObjectIDs are globally unique, and therefore safe if collisions are your concern. However, if you're talking about a session ID, the question really depends on if you are encrypting it client side and how. Typically the answers to those questions should be yes and as an encrypted cookie value

How to unset global variables.

时光毁灭记忆、已成空白 提交于 2019-12-23 15:05:11
问题 I have an id of a project and an id of a client that are sessions in php that are passed in JSON format. These are stored in global variables id_p and id_c so I can do multiple inserts and updates selects etc. with those ids. When the user selects another project or changes the page, I need to unset these variables. Can I pass a null value from php to the global vars to reset them? Is there a better way to do what I want? How could I store the php values on php only if the file is required?