FAQ Database Discussion Community


Setting Session for functions in Node Js

javascript,node.js,function,session,express
I have a web application I'm working on using Node JS and am running into a problem with the session store in req. I currently have the sessions working by having my app.js use: // Enable sessions app.use(session({ secret: '***********', resave: 'true', saveUninitialized: true })); app.use(passport.initialize()); app.use(passport.session()); // view engine...

Check if session data isset and apply error to each item

php,session
I have to do the following for a large amount of session variables, is there a way I can shorten this code to apply to all the variables rather than repeatedly writing out if(!isset($_SESSION['whatever'])) and adding the apropriate error to the errors array. if(!isset($_SESSION['fiat'])) { $errors[fiat] = 'Please enter valid...

How to display session data on view template in Laravel 5

php,session,laravel-5
I'm trying to display session data on a view template in Laravel 5. However it doesn't seem to show anything. Here is the code i'm using to set the session: Session::set('bookingConfirmed', BookingDates::where('id', Session::get('bookingFormData.slot.id'))->first()); Here is the code i'm using to display: {{ Session::get('bookingConfirmed->time') }} ...

How to access application data in a session .jsp file

java,html,jsp,session,user
I am new to the javaservice page session environment, and I am executing the following loop to view all my session attributes: <% for (Enumeration e = session.getAttributeNames(); e.hasMoreElements(); ) { String attribName = (String) e.nextElement(); Object attribValue = session.getAttribute(attribName); %> <BR> <%= attribName %> - <%= attribValue %> Which...

JSP session.getAttribute exception error

java,jsp,session
So I'm trying to make a shopping cart using sessions. If I add an item for the first time it'll succeed but if I add another one It'll return as exception error. (I already declare session.setAttribute("i","0") when you login as a member) Here's the doAddCart.jsp <%@ page contentType="text/html; charset=utf-8" language="java"...

Navbar login form in a Rails web app (with Bootstrap)

ruby-on-rails,forms,twitter-bootstrap,session,railstutorial.org
I'm making a Rails web app with the limited knowledge I have - mostly from the Hartl Rails Tutorial. I'm also using Bootstrap. I decided it would be good to have a dropdown login form in the navbar, in addition to the form at '/login'. The form looks nice enough,...

Php captcha session variable not found

php,jquery,session,load,captcha
I have this captcha.php file that I load on the page I want the captcha to appear on using jQuery load. In the captcha.php file I start a new session and I set a variable (theCaptchaCode) which contains the code you see on the image, but when I try to...

$this->session->unset_userdata not working?

codeigniter,session
So I have this login method: public function login(){ $this->form_validation->set_rules('username','Username','trim|required|min_length[4]|xss_clean'); $this->form_validation->set_rules('password','Username','trim|required|min_length[4]|xss_clean'); if($this->form_validation->run()== FALSE) { //Loading View $this->load->view('admin/layouts/login'); $username = $this->input->post('username'); $password = $this->input->post('password'); //Validate Username & Password $user_id =...

PHP - How to change PHP session after Exit to Ajax

php,ajax,session
I have a Login.php page where I post login information with AJAX to login.php. When I post Information, my Session values changed (in php and not in Html that Conditional with php). I use Session Value for Conditional Statement in Login.php. As long as page is not refreshing my Conditional...

symfony2 how to store session differently on one domain/IP with to different application

php,session,fosuserbundle,symfony-2.3
I have two different projects in symfony2. I am using symfony2.3 version. I have used fosuserbundle for user authentication. I have one server. I have uploaded my both projects at /var/www/html/project1 /var/www/html/project2 And i am accessing my two applications/projects like http://202.12.0.0/project1 and http://202.12.0.0//project2. (IP here is given only for example....

How to include PHP $_SESSION values in a javascript file?

javascript,php,session
I use $_SESSION['siteRoot'] to store the root address of my website in (it's basically a framework so this can change depending on the URL used to access the site). I need to use this value in some of my javascript files... Up until now I've been including my js files...

Why serialization is not required for InProc session mode

c#,asp.net,asp.net-mvc,session,serialization
I am using the state service session provider for my mvc application and if I don't serialize the type which I am going to store in session, application throws an error that class must be marked as Serializable. But if I switch to InProc session mode, session works even if...

Authentication with OAuth and JWT but without OpenID Connect

session,authentication,oauth,authorization,openid-connect
I’m wondering if I really need OpenID Connect to provide authentication on top of OAuth2. It seems to me if I generate JWTs (JWE) as my access token and I store user claims, roles/permissions, etc. in the access token, then the OpenID Connect's id token isn't needed. Resource servers can...

PHP Session Information Not Being Stored

php,session
I am trying to make a very simple website, where you can go to the main page and log in, of which the code is here example.org/login/index.php: <?php session_start(); $warning = $_GET['warning']; $nolog = $_GET['nolog']; $username = "Welcome, please log in"; if ($warning) { $username = "Wrong Username/Password Combination"; }...

How can i find user id and country with Session

php,mysql,session
These are my userpanel codes. On this page, I show username and pass with session code. How can I show this user country on this page? Thanks I have "uyeler" table. Rows are fname,lname,mail,password,country Panel.php <?php include('connect.php'); session_start(); if(isset($_SESSION["kullanici"]) && isset($_SESSION["sifre"])){ /*If there are sessions for username and password */...

Devise prevent auto sign-in after registration

ruby-on-rails,ajax,session,devise,registration
Here's my scenario : Users can register on my website by entering their university login. My app checks this login against the university LDAP, and if it exists, it will duplicate the university LDAP entry on my own LDAP + create a database entry for the user on the rails...

Common session.save_handler for all projects

php,symfony2,session,vagrant
I'm using vagrant virtual machine for local PHP development and I noticed that there are session write issues when using vagrant-winnfsd plugin. The plugin serves fine my needs, that's why I don't want to reconfigure vagrant, but rather solve the read/write problem. I don't know the origin of the problem,...

Laravel 5 Session variables not persisting after redirects Twitter OAuth

php,session,laravel,twitter,oauth
Using Codebird, I request oauth token here $reply = $cb->oauth_requestToken(array( 'oauth_callback' => 'http://localhost/laravel/public/callback' )); print_r($reply); $cb->setToken($reply->oauth_token, $reply->oauth_token_secret); Session::put('oauth_token', $reply->oauth_token); Session::put('oauth_token_secret', $reply->oauth_token_secret); Session::put('oauth_verify', true); Session::save(); $auth_url = $cb->oauth_authorize(); header('Location: ' . $auth_url); die(); Variables are all correctly put into...

Unable to add product to cart programmatically in Magento

php,magento,session
I have tried every possible technique to add product with quantity to cart ( in Magento), following are the things I have tried and forums/sites taken help from. But none of them is working. I am using Magento Community edition 1.9.1.1. If anyone has any suggestion/answer, please share. Tried to...

Wildfly 8.2 + JSF + SessionScoped : sometimes wrong data returned

jsf,session,cdi,wildfly,jboss-weld
In one of our systems in production we encounter a very weird problem in jboss 8.2 and latest JDK 7, centos 7 64 bits, latest primefaces on javax.enterprise.context.SessionScoped beans. (No jsf annotations are used in the whole project, only CDI annotation to avoid potential conflicts) At some point in time...

Distributed session implementation detail

c#,asp.net,session,azure
With the reference to the structure of session module in ASP.NET below: As I understand, when the application uses distributed session provider (.e.g. Redis in Azure), the SessionStateModule will deserializes the user's session data into Session dictionary at the beginning of a request. What I'm wondering is whether the module...

Is anything other than unset($_SESSION) needed for logout?

php,facebook,session
Is there any reason that unsetting the session wouldn't be enough for a logout? Is there some security reason more is needed? I have a script that uses the facebook login (using PHP). But for some reason, using any of the following messes with the login for some reason. After...

Python Django return no new page and no reload

python,django,session
I have the following view: def addtolist(request): var1 = request.session.get('session_pmids', False) pmids = request.POST.get('pmids', '') pmids = pmids.split(",") if var1: pmids = pmids + var1 request.session["session_pmids"] = pmids if not var1: request.session["session_pmids"] = pmids return HttpResponse(None, request) and in the template I have the following: <form id="go" action="/addtolist/" method="post" data_url>{%...

If session expires, automatically redirect home - Codeigniter

php,codeigniter,session
Is there somewhere in codeigniter where I could configure an automatic redirect to my root page if the user's session is expired (I am not trying to extend the session expiration's time)? Situational example: User logs in, leaves page idle for one day, returns to page that requires validated session...

Force WWW when URL contains path using .htaccess

.htaccess,session,url,redirect
I'm having a problem with my URL and my sessions. I wish to have ALL website pages be forced to use www. As it looks like now, the website looks like this: www.example.com into www.example.com example.com into www.example.com www.example.com/example/ into www.example.com/example/ example.com/example into example.com/example (this is what's wrong) This is...

Using Redis as a session state provider

asp.net,session,redis,stateless
I am wanting to create real RESTful APIs with ASP.Net. According to REST architecture. The application must be stateless. Meaning I can't use normal sessions. I found a document here describing how to use Redis as a session state provider. Since it would be external (as in not part of...

Get current session info using separate linked php file

php,html,mysql,session,echo
These are the only times Select shows up in the file. . . . function GetUserFromEmail($email,&$user_rec) { if(!$this->DBLogin()) { $this->HandleError("Database login failed!"); return false; } $email = $this->SanitizeForSQL($email); $result = mysql_query("Select * from $this->tablename where email='$email'",$this->connection); if(!$result || mysql_num_rows($result) <= 0) { $this->HandleError("There is no user with email: $email"); return...

Why php session var that is set has been lost after redirect by javascript

php,ajax,codeigniter,session
I have two page that are skytrip.localhost/searchresults and skytrip.localhost/bookingInfo In page searchresults , I make ajax request , then it is redirected to page bookingInfo. In ajax request , I set a sesion value , then I want to get this value in the page bookingInfo. But I can't get...

Ajax reset session php

php,ajax,session
I use my own Framework, in localhost all works perfectly fine but not on the server. I'm logged, so I've a session id. On a ajax request, the php script doesn't keep my session, if I return the session, the session are empty but me in my side, I keep...

Where to store access tokens?

c#,.net,rest,session,web-api
I am building a RESTful web api. Once a user is authenticated and authorized, they are given an access token which contains: user_id timestamp permissions My question is if it is better to encrypt those tokens using a symmetric algorithm and pass it to the client OR just pass a...

Disconnect Session via Powershell [closed]

session,powershell,user,server,disconnect
Is there a command to disconnect a user from a session on a server via PowerShell? To logoff i use: Logoff /server:<Server> <SessionID> ...

PHP :Initializing elements of session array

php,arrays,session,initialization
I have created a session array as $_SESSION[yans]=array(); I wish to initialize first 5 elements of this to 0.How it can be done?

Java ee session scope attributes for drop down lists

jsp,session,java-ee,scope
I'm trying to gain some performance on my application that search members in groups in ldap. My page shows 5 drop down lists which countains groups from different domains (around 150+ in each). I noticed that my application spend most of the time loading those drop down lists and little...

How do you trigger session garbage collection in PHP < 5.4?

php,session,php-5.3
I need to force session garbage collection to trigger in PHP, and I'm using version 5.3.3. I see in PHP 5.4, you can call: SessionHandler::gc() What is the best method to get the same result given the PHP version I am using?...

CodeIgniter session issue after sign out browser back button landed to the secured page

php,codeigniter,session,browser-cache
I am using codeIgniter 2.1.4 in my application. If am in a page that require authentication. Then I logout after logout if I use browser back button it will get me back to the secured page. I can only view the page. If I refresh or click on any link...

Redirect to login page after session timeout without postback

asp.net,vb.net,session
In my application I can already redirect the user to the login page after 5 minutes of inactivity. But this only happened after a postback. I wanted the user to redirect to the page after 5 minutes of inactivity without doing a postback. As long as he didn't click anything...

get information in database and insert into session codeigniter

php,database,codeigniter,session
i am new to codeigniter and using session. i am having a problem in inserting individual data in session. Model: function get_user_info() { $user_email = $this->input->post('signin-email'); $this->db->select('acct_id, acct_fname, acct_lname, acct_mname'); $this->db->where('email', $user_email); $query = $this->db->get('account'); return $query->result_array(); } Controller: public function LoginValidation(){ $this->load->library('form_validation'); $this->form_validation->set_rules('email', 'Email',...

Implement retryWhen logic

android,session,retrofit,rx-java
I have an app which requires session (cookies) to process web calls. Im using Retrofit+RxJava. However, session could expire (Retrofit error with 401 Unauthorized status) and i want to reauthenticate (to get fresh cookies) and retry previous call in this case. How would i do it with RxJava? My example:...

Have to reload page for if statement to be parsed

php,html,session,login
First: Code! loginform.html <form action="" method="post" id="loginform"> <h3>Login</h3> <input type="text" name="username" placeholder="Username"> <br> <br> <input type="password" name="password" placeholder="Password"> <br> <input type="submit" name="logsubmit" value="Login" class="registerbutton"> </form> login.php <?php require_once("../resources/config.php"); require_once("../resources/library/dbconnect.php"); function checkUser($con) { if...

python-requests does not grab JSESSIONID and SessionData cookies

python,django,session,cookies,python-requests
I want to scrape a pdf file from http://www.jstor.org/stable/pdf/10.1086/512825.pdf but it wants me to accept Terms and Conditions. While downloading from browser I found out that JSTOR saves my acceptance in 2 cookies with names JSESSIONID and SessionData but python-requests does not grab these two cookie( It grab two other...

PHP login script

php,mysql,session,login
I have the following PHP script for login. When I type valid credentials then it does not redirects to index.php. It simply reloads the page But when I type wrong credentials it gives me message which is OK. My PHP code is as follows: if(isset($_POST['submit'])){ $username = mysqli_real_escape_string($con,$_POST['username']); $password =...

Laravel: Locale Session: Controller gets Parameter to change it but it cant. U have to hardcode it

session,laravel,locale
I tried to create a Form and do away with Ajax. Yes, the form at least does send the parameter down to the Controller as I var_dumped it and exited in order to see if it had gotten the new value, and yes it did, but guess what? and here...

Django rest framework, JWT and request.session

django,session,session-variables,django-rest-framework,jwt
I use Django rest framework with JWT for authentication and everything works perfectly BUT... I need to save an information about the user in a session var at login and I really don't know where I can do the request.session['mydata'] = plop I tried : def jwt_response_payload_handler(token, user=None, request=None): serializedUser...

PHP Session data lost after jQuery POST request

php,session,post
I know that this question seems like it is the same that it has been asked a lot of times, but please keep reading. The problem is, like the title suggest, the session data is not being saved in my PHP scripts when I make a POST request to another...

PHP session array multi

php,arrays,session
Can some one help me with this? var_dump ($_SESSION['korpa']); Result is this: array(3) { [0]=> array(2) { ["kolicina"]=> int(2) ["item"]=> string(1) "1" } [1]=> array(2) { ["kolicina"]=> string(2) "50" ["item"]=> string(1) "1" } [2]=> array(2) { ["kolicina"]=> string(1) "1" ["item"]=> string(1) "1" } } If $_SESSION['korpa'][0]['item'] exists two or more...

Symfony2: setFlash with basic html in the message

symfony2,session
I'm trying to set a flash message for my template that includes very basic anchor to another page in the app. Using the standard method apparently won't do the job: $this->get('session') ->setFlash('message', 'Some <a href="#">link</a>'); I found some suggestions in Symfony's 2.0 forums, but they don't work either: $this->get('session') ->setFlash('message',...

TypeError: can't pickle file objects webpy and subprocess

python,session,pickle,web.py
I am trying to make this following code possible. But I keep getting "TypeError: can't pickle file objects" error. I am both new to python and webpy. Can anyone tell how can I achieve this code. import web import subprocess web.config.debug = False urls = ( "/start", "start", "/end", "end"...

What are the techniques to manage “session” or invocation context for Stateless EJBs during Remote calls?

session,java-ee,ejb,rmi,java-ee-6
I am writing an application that uses RMI to invoke EJBs. The EJBs are Stateless; the business requirements do not require conversational state with the client. One of the parameters to the EJB method calls is a "User" object used to determine if the user associated with the call has...

magento write to or read from session using db value

php,magento,session
I'm working for a company that has chosen to use the db for session handling in magento. Specifically, in /app/etc/local.xml there is this entry: <session_save><![CDATA[db]]></session_save> I understand that the data is being saved in the table core_session. However, I'm not familiar with how to read from and write to the...

how to store cookie permanently

c#,asp.net,session,cookies,web-config
I don´t want to show mail id in my application code. I want to give text box and what ever email id I will give it should be stored in web.config file for ever until I change it. string store= "[email protected]"; ConfigurationManager.AppSettings["MailId"] = store; string message1 = ConfigurationManager.AppSettings["MailId"]; <appSettings> <add...

Logging DateTime in SQL Table When Users Session Ends

c#,sql,session,datetime
I have written an application and with this application the user has to login. I have a table where I am keeping their login token for that session, datetime they logged in, datetime they logged out and the duration in which they were logged in. This functionality works great when...

Use a socket on several pages

php,sockets,session
I am working on a php application that is sending data through a socket. On my main page I establish the connexion with the client, and I would like to send data from another page of the web app.. but I don't know how to do that. I am currently...

Session Destroyed on page refresh

php,ajax,session
i have php file which works fine on the first load but session is destroyed after refresh page. On refresh php page i get Warning: session_regenerate_id(): Session object destruction failed <?php /** functions.php **/ function startSession() { $session_name = 'sec_session_id'; // Set a custom session name session_name($session_name); session_start(); // Start...

multiple SESSION cookies being set?

php,session,cookies
My site is sending two different session id cookies (PHPSESSID), one under "www.sitename.com" and the other "sitename.com". I read this answer here which says to specify the domain used in the 5th parameter, but what about SESSION cookies which are created automatically? I think the issue is that the facebook...

Having problems building my login-function, cant store sessions (php)

php,session
I am a Beginner. Right now I am trying to build a simple Login/Register-System to learn. It worked once, but not anymore and I cant figure out where im going wrong. Slowly my Code becomes Spaghetti. What I want: LOGIN-System that starts a Session after logging in. But the session...

how do i store these values into just one Session PHP

php,session
I have this variable that contains multiple values and I want to save all the values into a $_SESSION['gamecode']. It displays only the last value. $var=explode("|",$key); $gamecode=trim($var[0]); session_start(); $gc[]= trim($var[0]); $_SESSION['gamecode'][]=$gc; var_dump($_SESSION['gamecode']); EDITED foreach($_POST['gm'] as $key => $answer){ if($answer != ''){ $var=explode("|",$key); $gamecode=trim($var[0]); $_SESSION['gamecode'][]=$gc; var_dump($_SESSION['gamecode']); EDIT 2 foreach($_POST['gm'] as $key...

Is it a good practise store the checkout steps fields in php $_SESSION?

php,session,e-commerce,checkout
I have my e-commerce site with three checkout steps, each button to continue is a POST action and redirect to the next step: if the user navigates by the checkout steps (click on the previous button for example), the form fields don´t show the data posted previously. This form fields...

Does cycle_key destroy previous session?

django,session
I want to use this function request.session.cycle_key() to rotate session key. In documentation it is said: cycle_key() Creates a new session key while retaining the current session data.django.contrib.auth.login() calls this method to mitigate against session fixation. So, it is not said whether the previous session is destroyed or not. However,...

How to use sessions in PHP with loginfunction?

php,session
I have used a hash encryption of the password for the user so in the login i check with password_verify if the passwords match and that part of the code seems to be working. And everything inside of the if statment besides something with the sessions. The header Location works...

Put arrays in session symfony2

php,arrays,symfony2,session,symfony-forms
I have the following code : public function addAction(Request $request){ $aBasket[] = $request->request->all(); $this->get('session')->set('aBasket', $aBasket); return $this->redirect($this->generateUrl('shop_desktop_homepage')); print_r($aBasket); } Works fine but is saved in session only the last array wich was save. How to put in session. For example, the array is saved like this, only the last :...

$_SERVER['HTTP_COOKIE'] return's two PHPSESSID

php,session,session-cookies
I am getting two PHPSESSID while printing $_SERVER['HTTP_COOKIE']. Actually I don't know how it is set twice, its only in my local system. When I check the SERVER cookie it like: echo $_SERVER['HTTP_COOKIE']; //result 'fe_toolbar=false; fe_toolbar=false; PHPSESSID=4tvbovcjk0msf9dvibeb31c2b7; langId=1; backendLangId=2; PHPSESSID=46aagg1hg7as2uh9bihjlpp8h7' When I check my cookie alone like : print_r($_COOKIE); //result...

How to access save session data

node.js,session,restify
I'm using Restify module to create REST server and using Restify-session module to save user credentials. However, I cannot seem to retrieve save session data. My request object does not have session data I saved earlier. I tried 'load' method of session object and data parameter of the callback function...

How can I correlate session.sessionid and IIS Log session cookie?

asp.net,session,iis,asp-classic,iis-6
We are logging some tracking information to a database table within a classic asp site. One of the pieces of information captured is the users session ID (session.sessionid). Examples of what is captured are: 808592330 14267388 78330403 Then, separately in our IIS logs, session cookies are logged as such (these...

Cannot read from table (SQL and PHP)

php,mysql,forms,session,login
I've been trying to create a login form for my website but the form seems unable to connect to the table or retrieve info from it. I even tried obtaining some sample code online, but it is still not being able to connect. Here's the code: session_start(); $error=''; // Variable...

Meteor: Passing Session values from client to server

javascript,node.js,session,meteor
I am using the following code on the client side to set the Session variable: Template.download.events({ 'click button': function() { var clientid=Random.id(); UserSession.set("songsearcher", clientid); console.log(clientid + UserSession.get("songsearcher")); I am using the following pacakge: Meteor-User-session, which will explain the use of UserSession in place of Session. Now, this works fine. But...

__PHP_Incomplete_Class Object even though class is included before session started

php,class,session
I have a "page" class that on it's construct includes a "shoppingCart" class, starts a session, creates a shoppingCart object, and then sets $_SESSION['shoppingCart'] to the shoppingCart object. I still get an incomplete class when I print_r the session... I thought this only happens when you start the session before...

Revert back to previous flask session variables when going back a page

python,session,flask
On a Flask website of mine, I have a session variable called 'thisQuestion' which put simply increments by 1 each time a page is loaded. Basically, the page returns questions from a database and the user can state whether they get the question right or wrong. The session variable increases...

Access property of an object of type [Model] in JQuery

javascript,jquery,asp.net-mvc,session
So in my MVC project I have a custom Model called Survey, which contains a handful of properties. In the Survey Controller, I am saving Survey to a Session variable, so that the values of the survey's properties are persisted per session. I want to be able to manipulate the...

User Getting Logged out in IE when closing browser

internet-explorer,session,cookies,p3p
I am running a Drupal 7 site and am noticing a problem on IE9, when the browser window is closed the user is logged out. We have "remember me" module enabled and the cookie is set to not expire. There is no issue on Chrome or any other browser, you...

How to share the same email session between all instances of the application?

java,session,java-ee,javamail
Maybe this question is already answered, but I couldn't find the proper answer. I have a web application based in JSF, and I want to share the same email session between all the instances of the application, yet I haven't found how to do that. My questions are: a) What...

How to check that value exist in YII Session Variable

php,arrays,session,yii,session-variables
I am using yii and creating a cart, by using id of product i need to check that id already exists or not , but i use in_array and array_key_exists but unable to solve it Here is my code of controller public function actionCartupdateajax() { //start yii session $session =...

Is php session unchangeable from user end? [duplicate]

php,session
This question already has an answer here: Can a user modify a PHP session? 3 answers I am developing my own application which requires user login. All users and passwords (encrypted) are stored in a database. When a user tries to login, then it search in the database the...

PHP session variable not accessible on another page

php,session
After trawling through other posts, I could not find the answer. The problem is that when i create a custom session name, I am not able to access session variables on any other pages. How can I get this working with custom session variable? Scenario A Login page after successful...

Does OPEN SYMMETRIC KEY (SQL Server) remain in scope on a server farm?

c#,.net,sql-server,session
On this page, I read: In the OPEN SYMMETRIC KEY topic in BOL (under Remarks section) we documented that the opened key is bound to the session, not to the execution context (including a module frame) and that it will remain opened until the key is explicitly closed (using CLOSE...

How to read and write Session in Cakephp 3.0

session,cakephp-3.0
I am new to cake 3.0. I have read documentation on http://book.cakephp.org/3.0/en/development/sessions.html But I am not able to write sessions. use Cake\Network\Session\DatabaseSession; $session->write('Config.language', 'eng'); $session->read('Config.language'); ...

PHP delete values from Session Array

php,session
I want to delete some items from shopping cart, which is stored in a session variable named $_SESSION["products"] The deleting part is working fine until there are different sizes of products with the same product code, when a request to delete is called for the specific size all the items...

codeigniter session object expired availability

php,codeigniter,session,session-state
This might be a silly question. Once a user has been logged in, if session expires I want to redirect him to a "lockscreen" instead to a "login" page. I want to send to the lockscreen some session data (like img-src and loginname) So, here's the question. Does session object...

Settup form script for ajax and post calls

php,ajax,session
i would like to know if its possible to set up my script so it can be handled by http ajax call and alternatively also the classic post way: on the top i am first doing this: if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){ $AnswerType = 'die'; } if ($_SERVER['REQUEST_METHOD'] ===...

Sessions in a RESTful API [duplicate]

rest,session
This question already has an answer here: Do sessions really violate RESTfulness? 6 answers I am currently reading up on REST, and one of the specifications of REST is that it should be stateless, and that every request should contain the necessary state in the URL or the body...

Persistent session in glassfish behind nginx proxy

java,session,nginx,proxy,glassfish
I am running a glassfish webserver behind a nginx proxy (which resolves domains). I want to store @SessionScoped data on the Webserver. My problem is, that nginx opens a new session everytime it connects to glassfish and that session is in no way connected to the client. The client itself...

perl - convert cgi::session file into a hash

perl,session
I'm looking for a graceful way to read a cgi::session file into a hash, without loading the session and updating the access time. Here is what the data in the session file looks like... $D = { '_SESSION_ETIME' => 283824000, '_SESSION_ID' => 'a07d36e7d9bc89d46a64ae271fe3709e', 'userid' => '99999', '_SESSION_REMOTE_ADDR' => '111.222.333.444', '_SESSION_CTIME'...

session value in javascript cannot be set

javascript,function,session
I am quite new to javascript, I wonder why my session value in javascript wont be set to 1 even I tried. When call this function again, the value of the session will change again. My javascript code as below. <script type="text/javascript"> function Confirm() { alert(<%=Session["Once"]%> != 1); var value...

(node.js) How to get cookies from remote server?

javascript,node.js,session,curl,cookies
In PHP, getting cookies sent from a remote server is simply a matter of using cURL with some cookie handling option enabled. If I was to treat my server as a client making requests to a remote server, I was wondering how this might be done in node.js? Would my...

Cant remove item with session array in shopping cart

php,session
I have a session array for shopping cart, but the problem is when I try to remove the selected item with UNSET command it seems not working. Somebody please help me. I like to remove the item based on product ID and Size, because some other item in my shopping...

How to determine the session type in asp.net

c#,asp.net,asp.net-mvc,session
I want to change the session storage mode from inproc to some other third party session provider in my application. I have downloaded the standard provider written for it. I am using this provider in project and provided the server details in web config the session is working as expected....

Server side session in asp.net

asp.net,web-services,session
I want to set one value in server side session in client side and need to access that session in web service, so i tried below In client side : //Set the server side session like below var vr_="demo.png"; '<%Session["path"] = "' + vr_ + '"; %>'; //In alert,checked the...

MVC Referencing strongly typed session objects on my view

asp.net-mvc,session
According to various sources online i should use this public static class SessionExtensions { /// <summary> /// Get value. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="session"></param> /// <param name="key"></param> /// <returns></returns> public static T GetDataFromSession<T>(this HttpSessionStateBase session, string key) { return (T)session[key]; } /// <summary> /// Set value. ///...

Django cannot read session under subdomain but working under IP Address

django,session,firefox
I use django 1.7 with python 2.73. I set up django on Windows Server 2008. Code just like this, nothing special, typing a username and and save session, then jump to another view. def login_user(request): error = None if request.POST: form = LoginForm(request.POST) username = request.POST.get('username') password = request.POST.get('password') try:...

Are session variables shared across threads?

asp.net,vb.net,multithreading,session
I am working on a VB.Net project, and I want a fast and dirty way of having a second thread preform some function, then store some variable outcome to the session. Then I want to access that variable from the first thread (in the same session of course). Here is...

Session array unset and delete row

php,arrays,session,unset
I get the id of a product and try to delete from my session array.I use unset and everything goes well but when i try to display the data in a loop the session still have the deleted row so i get the error Undefined offset: 0. I use a...

mySQL crashing due to /tmp full of PHP session files ..what to do?

php,mysql,session
I run a fairly busy website that creates lots of session files in the /tmp folder. Recently I started getting this mySQL error: MySQL said: Can't create/write to file '/tmp/MLX3o6NG' (Errcode: 28 - No space left on device) So I checked with df -i and found: /usr/tmpDSK 262144 262143 1...

OSX tmux configuration session open file in vim automatically

osx,session,vim,configuration-files,tmux
So I have tmux and vim running in iterm2 on OSX. I have a tmux.conf file that sources a session in ~/.tmux/ called 'left'. I have successfully loaded this session with three panes. Two panes in a left column and a single pane on the right. I have also managed...

Predis: Pros and Cons of the two cluster strategies

php,session,redis,cluster-computing,predis
I am using Predis to connect to a Redis 3.0.2 cluster. So, I have an option to use either predis or redis cluster strategy. I am wondering if there are any significant pros and cons of choosing one of them over the other? Based on my wandering through documentation, I...

after puttin php syntax, my website get stuck at preloader

php,twitter-bootstrap,session
I have this code on my php file for navbar: <?php if(!$session->is_logged_in()) { echo ' <a href="login.php" role="button" aria-expanded="false"> Login <span class="label"> login to system</span> </a> </li>';} else { echo ' <a href="#!" class="dropdown-toggle" role="button" aria-expanded="false"> ' . $session->user_name; . '<span class="badge bg-default">2</span> <span class="caret"></span> <span class="label">it is you</span> </a>';...

save selection in session and show in table

php,html,session,selector
I have a selector that selects all the data from my database. <?php $results = $database->Selector(); ?> <form name='form' method='POST' id='selector'> <select name='train_id[]' id='train_name' multiple='multiple'> <?php foreach($results as $train_details){ //Look through every result in DB echo "<option value=" . $train_details['train_id'] . ">" . $train_details['train_name'] . "</option>"; } ?> </select><br />...

Symfony2: ajax call redirection if session timedout

ajax,symfony2,session
I have a working dashboard with ajax request. I fire an ajax request on some events which will update a part of the dashboard. But if the session has expired, the part will be refreshed with the login page. How can i do a redirection after the ajax call if...

Is it possible to share session between different PHP versions?

php,apache,symfony2,session,iis
I am starting an old app refactoring, I will rebuild some functionality from spaghetti code to MVC (Symfony). Plan was I will set up new IIS app, using subdomain. Now, old app is running PHP 5.3 which can't be upgraded. New app will be running on PHP 5.6. Only thing...

Runtime Error using Redis Cache Session State Provider

asp.net-mvc,session,azure,stackexchange.redis
So I have an MVC application in which I am trying to use Azure's Redis Cache for my Session State Provider. With everything coded and configured and all, when I publish it, the index page loads fine. The only button to hit is 'Next', which is supposed to add a...

Spring Junit with session object - not visible in Controller

java,spring,session,junit,spring-junit
Simple Test class have the following: @Autowired private WebApplicationContext wac; @Autowired MockHttpSession session; private MockMvc mockMvc; @Before public void before() { this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); } @Test public void testSetSomeType() throws Exception { this.session.putValue("PREV_PAGE_VAL", "FOO"); System.out.println(this.session.getAttribute("PREV_PAGE_VAL")); //FOO is there, so far so good, but in the controller, its null RequestBuilder requestBuilder...

What's wrong with my session? When I reload the page it says it has a redirect loop [closed]

php,mysql,session
When I reload the page it says : This webpage has a redirect loop. What is wrong with my code? could somebody help me please. $row = mysqli_fetch_assoc(sql); $login_session = $row['username']; if(!isset($login_session)){ mysql_close($connection); header("Location: AdminLogin.php"); } ?> ...