Questions tagged [session]

A session denotes the interaction between an individual user and a server. Each session is personalized to the user, and upon each new user access, a fresh session is generated to monitor all their subsequent requests.

What is the best way to extract a session variable from a class in PHP?

Is there a way to access variables outside of the class? ...

Create a separate server session specifically for handling an ajax request?

Currently, I am working with a collection of PHP server-side scripts that manage user session state by utilizing PHP sessions extensively for authenticated users. For the client side within a mobile application and using Jquery ajax, I am striving to esta ...

Ways to refresh the session on the server end

What is the process for updating a session in the server side using authV5 in the most recent update of nextjs? I have attempted the following: import { update } from "@/auth However, I am unable to locate the update function within the auth module ...

Working with PHP sessions and AJAX requests triggered by injected JavaScript code

Trying to figure out what is missing in my code. I have a simple logging.php file on the server. Passing parameters like user/password creates a new session. Using loggout will destroy the session. And passing report displays a list of current session var ...

PHP sessions become unset

After successfully using a session variable to store login data locally, I encountered an issue when transferring the files to the server. For some reason, I kept getting logged out between pages. In an attempt to solve this problem, I came across a post o ...

Malfunction of middleware in Node.js

Currently, I am facing an issue with the following code in my app: app.use(session({secret: 'JKSBDFJKQS444SQ4DQSND'})); After running my app file, I encountered this error: Error: Most middleware is no longer bundled with Express and must be installed ...

"Storing user information during a session in Node.js with Express and Socket.io

I am currently testing out this code snippet that I found online: var io = require('socket.io'), express = require('express'), app = express(), server = require('http').createServer(app), connect = require('express/node_ ...

Unable to retrieve session data from a different route

Currently utilizing client-sessions with the following code snippet: app.post("/login", (req, res)=>{ if (!req.session.activeUser){ User.findOne({username:req.body.username}).then(doc=>{ req.session.activeUser = req.body.use ...

Attempting to transform a mysql timestamp into standard time by utilizing the strtotime function

strtotime($_SESSION['starting_timestamp']) I attempted to convert the MySQL timestamp stored as $_SESSION['starting_timestamp'], which has a value of 1422094831. However, when I applied strtotime function on it, it did not return any value. I am unsure a ...

Unable to deactivate account, experiencing technical issues

After running once, the code in deactivate_myaccount.php throws an error stating: "Notice: A session had already been started - ignoring session_start() in C:xampphtdocsincludesincludesheader-inc.php on line 2". Furthermore, the intended functionality ...

How can I effectively save data to a session using connect-redis?

I am looking to save the username of an account into session storage. I am currently using node.js with the expressjs framework and have attempted to utilize connect-redis for storing sessions, following a tutorial on expressjs. Can someone please guide ...

Establish and oversee remote connections for a variety of devices

I have a unique setup where I am using a cross domain and PHP server to retrieve user information when they log in. On my website, I incorporate PHP code that includes: session_start(); After a successful login, I declare the user information as follows: ...

manipulating session variables with javascript ajax and php

I'm struggling with setting and retrieving session variables using JavaScript code that calls PHP functions via AJAX. I want to access the returned session field in my JavaScript, but nothing seems to be working. Can someone take a look at my code and poin ...

Session handling in PHP is not cross-server compatible

Why are PHP session variables not transferring across servers? This example is being used to troubleshoot the issue. Please review. file1.php <?php session_start(); $_SESSION['FirstName'] = Kshitij ; $_SESSION['LastName'] = Kawatra ; ...

Establishing a user session with Node.js

I am new to the world of node.js and JavaScript in general. I have a piece of code that currently handles login functionality by checking if a user exists in a MYSQL database. This part is functioning correctly. Now, I wish to improve this feature by crea ...

Is it possible to delete browsing history in Express using node.js?

Upon user login, I store user information in browser sessions on the client side (using Angular) like this: $window.sessionStorage.setItem('loggedInUser', JSON.stringify(val)); For logout authentication on the backend (using Passportjs), I have set up th ...

The session is not being established despite the Set-Cookie header being transmitted

I am managing three services - be, fe, and auth. These services are all hosted on App Engine with a load balancer set up to keep them under the same domain. My goal is to create a session upon user login. The issue I'm facing is that even though the set-co ...

"Exploring the concept of a two-dimensional $_SESSION array in

In the process of creating a server-side workers manager script, I have encountered a challenge with managing multiple instances in the same browser. Currently, each instance saves job data in $_SESSION and calls itself with the next task to be completed. ...

Passport: user information is not saved in the session

Recently, I delved into the world of nodejs and decided to create an authentication system. Following a tutorial, I successfully implemented it. To retrieve the user object after authentication, it is necessary to store it in the session. This was achieved ...

Troubleshooting session persistence post-redirect

Learning PHP has been quite a journey for me, especially when it comes to working with SESSIONS. I recently started using the Instagram API and managed to successfully authorize an app, redirecting to a page to display content. Organized in my main folde ...

Transferring a PHP session variable to JavaScript in a separate file

I successfully imported data from a CSV file into PHP and organized it into a nested array. To ensure the data is easily accessible across different files, I stored the array as a session variable. Now, the challenge lies in accessing this session variable ...

Building a customised-schema table for storing data with express-mysql-session

I am exploring the option to store the user id in the MySQL Database's sessions table using express-mysql-session. Initially, I set the user id in the middleware as shown below: import "dotenv/config"; import express from "express" ...

I encountered an error in Laravel that stated: "The visitor variable is

Hello, I am trying to add a comment to a blog while displaying the name of the patient who added it using session. However, I encountered the following error: Undefined variable: visitor This is the commentcontroller.php: public function store(blog $getI ...

Creating a PHP session exclusively for a subdomain within a specific domain

I have a unique system where each client is assigned their own subdomain. Users are currently able to log in directly from their subdomain, but I am looking to enable login from the main domain as well before redirecting them to their respective subdomains ...

Enhancing communication with Socket.IO's private messaging feature

It feels like I have asked this question countless times already, but none of the answers seem to satisfy me. So, here I am trying once again, being as clear as possible. I am setting up a fresh Express project using the usual terminal commands: user$ ex ...

Issue with passing PHP session variable during AJAX request processing

I've been working on a script that echoes different answers based on selected values. Right now, I'm just testing with one value but plan to expand later on. The PHP script is triggered through AJAX so the results display on the same page. Howev ...

Every time I open my browser, my Node.js web app creates a fresh session

Whenever I close all browser windows and reopen the web app, a new session is initiated, forcing me to re-authenticate each time. To give you an idea, my web application framework is <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfema ...

Deleting a specific item from the shopping cart in PHP by utilizing a form with a value of $i

Currently, I am working on a straightforward project involving a shopping cart where I extract data from my database. One part of this shopping cart allows users to delete a single item, and most of it is functioning as expected. The issue that I am encoun ...

What are some ways to verify authorization without adding burden to the database?

While working with node.js, I've been considering storing a session id in the session variable to verify user authorization for each page request by checking against the database. However, this approach seems inefficient as it involves a database call ever ...

Creating session variables in Joomla using checkboxes and AJAX

I'm currently working on implementing session variables in Joomla with AJAX when checkboxes are selected. Below is the code snippet from select_thumb.ajax.php file: $_SESSION['ss'] = $value; $response = $_SESSION['ss']; echo ...

How can I remove specific items from a session array when they are selected?

I am seeking a solution that will allow me to remove a specific item from an array when that item is clicked. For example, if I click on "Two", it should disappear. See a demonstration here: CODE: <form method="post"> <input type="text" i ...

Using C# to retrieve session values from a webpage

Is it possible to retrieve values stored in a PHP website session from a separate C# program running on the same machine simultaneously? If not, is there another way to capture the current textbox value and store it in a C# variable? ...

How to verify changes in session variable using PHP and AJAX

Hey there! I'm looking for a way to continually monitor changes in a session variable within PHP. Let's say the session variable "x" starts off with a value of "1" and then, after five seconds, it changes to "2". This session variable "x" is updated usin ...

Creating a multilingual website using PHP, MySQL, and cookies

Having developed a multilingual website using PHP and MySQL, I am currently facing issues related to robots, SEO, and search engines. This is mainly due to the fact that the language selection mechanism relies on cookies. The current process is as follows ...

Is it possible to implement sanctum on multiple Vue projects simultaneously?

Greetings! I am currently using Sanctum to authenticate users in the system. My goal is for a user who logs in to vue project num1 to also be automatically logged in to vue project num2. I attempted to implement this functionality using cookies like so: $ ...

passport not initializing session with requests

I am currently utilizing passportJS for managing login and persistent sessions on the server backend. While everything functions properly when sending requests from the server frontend (a webpage that I didn't create and lack sufficient knowledge to ...

Maximum Age Setting for Iron Session Cookie

Currently, I am attempting to configure a Next JS application with iron-session and a 'remember me' feature. The objective is for the maxAge of the iron-session cookie to be extended to a week if the user selects the remember me option on the login form, a ...

Automatically unset session variable 'unsetted' using a simple line of code

Why does the session information not get saved? When I reload the page, the session variable 'mucciusersess' disappears. What could be causing this issue? Thanks... I have a cookie on the client-side with a value like 'mucciuserid' set to '122341212' ...

Encountering difficulty in reading a session variable when accessing it through Ajax, however, the variable is successfully retrievable when called from the controller in ASP.Net

I have implemented a method within the controller to retrieve the value of a session variable. However, when I attempt to call this method from Ajax jQuery, I am unable to obtain the value. Interestingly, if I try to read the session value from another met ...

Having trouble reaching the io object in session.socket.io

I have integrated session.socket.io into my application. o = require('socket.io').listen(tmpServer), appCookieParser = express.cookieParser(settings.cookie.secret), appRedisStore = new RedisStore(), sessionIO = new SessionSockets(io, appRedisSto ...

Different Approaches to Authentication in Next.js

I've been working on establishing a secure authentication process for my Next.js project, but I'm feeling quite lost at the moment. Despite referencing the examples in the Next.js repository, I still have numerous queries regarding a comprehensive solution ...

Tips on safeguarding your templates while working with SailsJS and AngularJS

I am currently working on a web application using SailsJS and AngularJS. My project requires session management to track user login status. I came across this helpful tutorial and implemented an index.ejs view located in the /view folder. Within the index. ...

The importance of managing session data

Here is my issue: I want only one session to run at a time. Consider the following query: $get_crs_mysqli .= (!empty($_SESSION['userSearch']))?(" AND (course_title like '%".$_SESSION['userSearch']."%') OR (course_title like '%" . $_SESSION['userCategory'] ...

Instructions on transferring input data from a text box to the next page using a session in PHP

Is there a way I can transfer the data from a text box to another page (demo2) and store all the information in my database? I attempted to use sessions, but although the value is being passed to the next page, the text box data isn't... Check out the fol ...

Difficulty Implementing 'js-cookie' Library in NPM: Challenge with Managing Cookies

Encountering an issue with the js-cookie library while working on my Node.js application. I'm utilizing it to handle cookies, particularly setting a cookie called 'gameData' with the value 'value'. However, when attempting to retrieve the cookie value usin ...

Error in client-sessions module of nodejs/Express: Unable to assign value to property 'mydata' as it is undefined

I've been experimenting with the client-sessions middleware in my nodejs / Express project and encountered an issue that says: Cannot set property 'mydata' of undefined. While researching this problem, I came across a post on Stack Overflow ...

Obtaining a cookie for the PHPUnit test involving Ajax functionality

When it comes to writing PHPUnit tests for ajax endpoints, I find it easy when the user doesn't need to be logged in. However, for the specific endpoint I want to test, the user must be logged in and I need to programmatically retrieve the cookie as part o ...

Even if the user is logged out of the website, Socket.io authorization remains persistent

I have successfully integrated the express-socket.io-session into my app and it is working as expected. However, I have encountered a specific issue. Please see the code snippet below: io.use(...); io.sockets.on("connection", function (socket) { soc ...

"Is it possible to determine if a PHP session is currently set or unset

In my PHP project, I am trying to implement a check on the Login page to verify the status of the session. If the session is not set, I want the user to be redirected to the login page. However, the code I added to the login page seems to cause a loop. if ...

Storing user data in node.js using the express-sessionTo save user data in

Using express and express-session with mysql on nodeJS has been successful for me. I managed to set up a cookie and session as well. Take a look at my code: app.use(cookieParser('3CCC4ACD-6ED1-4844-9217-82131BDCB239')); session({resave: true, saveUniniti ...

Guide on utilizing session variables in NodeJs

In my current NodeJS code, I have the following: let sql = `SELECT box_id, cubby_id, occupied, comport FROM box WHERE longestDimension = ? AND LOWER(box_id) = LOWER(?)`; connection.query(sql, [boxSelectedDimension, ...

Detecting the presence of a session in Angular2 and nodejs using express

My server-side session creation is functioning properly, but I need to be able to hide certain elements in an Angular2 component template depending on whether the session exists. How can I check within my Angular2 component whether the server-created sessi ...

Implementing a Hands-on Approach to Session Initialization in PHP after Manual

I've implemented a login system that generates a unique token for each login attempt, which is stored in the `$_SESSION['loginToken']` variable. After submitting the login form, it checks if the session value matches the input from the form. Additionally, ...

Concluding the session upon exiting a directory or specific web addresses

Is there any way to terminate or cancel a session when I depart from a specific folder on the website, like /maps/, or simply end it when I'm not certain URLs? At present, I am utilizing: <script> $(window).on('unload', function() { var fd = n ...

Effectively handle sessions using express and backbone

When working with sessions in express.js, I know that we can access a session id using req.session.id, and this id is always unique each time we visit a route. I've seen some suggestions to get and store the session globally. However, the issue arises whe ...

Can login data be transferred from the index page to other pages?

Working on a school project involving a Weather info web page has been quite the journey. Most of it is complete, except for one issue that I can't seem to figure out. The index page with login and registration functions is connected to phpmyadmin/mys ...

Is it possible to save round items within a session?

While utilizing Blocktrail's API for bitcoin wallet management, I encountered an issue with circular references within the returned wallet object. The goal is to store the decrypted wallet in the user's session to avoid password re-entry. However, attempt ...

Tips for properly configuring a session with everyauth and express

I've been working on a simple nodejs application that allows users to log in with Facebook using express and everyauth. I followed the instructions provided in the README tutorial here and set up my app.js file as shown below: var everyauth = require('eve ...

Issue with holding session in Mongoose-Auth/Express/Connect not being resolved

Currently, I am in the process of developing a node js app and attempting to implement a user authentication system using Mongoose-Auth. Despite following several tutorials and guides on how to use Mongoose-Auth, I have encountered a hurdle. The basic pas ...

Is it possible to transmit information using the express next() function?

I am currently developing a web application that involves authentication process and session management using express. I have successfully implemented the backend sessions functionality. Now, my goal is to display on the user interface the information of t ...

Is there a way for me to access session variables in dokuwiki's main.php that were set outside of the dokuwiki pages?

When I try to create a session variable in a PHP file with the index 'fullName', I encounter an 'Index not found error' when attempting to retrieve the variable from Dokuwiki's main.php. The session values are not being saved in that session. However, if I ...

Encountering issues with browser tabs and Socket.IO

I'm currently working on a real-time chat using Socket.IO, but I've encountered a major issue. The aim is to allow users to log in, select another connected user, and start chatting... var http = require('http'), fs = require(&ap ...

The HTTP response header failed to include the Set-Cookie parameter

Currently, I am in the process of developing an Authentication page using React and Express, where JWT is also implemented. In the backend, I have created the following routes: server.js ... app.use( cookieSession({ name: "prode_session", ...

What strategies are most effective for handling sessions in Node.js?

Currently, I am delving into the world of Node.js and I find myself pondering the best approach to handle sessions. Upon my investigation, it appears that there are primarily two options available: express-session and cookie-session. Sources suggest that ...

Can you show me the steps to set a session in the front-end using Nuxt

I have successfully set the session using code on Postman. First: I set my session and it is functioning properly. const user = { name: 'afshin', }; req.session.user = user; res.status(200).send({data:req.session.user,status:200}); Second: Now, when I ...

Session management in Node.JS can be implemented without the use of

Even after multiple attempts, I have discovered that iOS 5 does not accept cookies by default. Despite trying various approaches, including utilizing Redis, I still cannot maintain a session for more than one request. Considering the limitation with cooki ...

Occasionally, the 'req.user' property in Passport may unexpectedly become undefined

Currently, I am utilizing Passport for authorization and storing sessions in MongoDB using the 'connect-mongo-session' module. One issue I have encountered is that sometimes, when attempting to log in after some time has passed, the req.user object becomes ...

Passport sessions persist even after the browser is closed

I'm currently working on implementing remember me functionality for my Node.js server using passport for session management. However, I've encountered an issue where the session cookie connect.sid is not being destroyed on browser close, which sh ...

Obtain the unique session identification code from the React application

Currently, I am diving into learning Express.js and exploring how to build an API while connecting it with a React frontend. During this process in Express, one of the key components I am utilizing is express-session for managing sessions. Additionally, fo ...

What steps should be taken to manage expired sessions with the combination of spring-security and jQuery?

In my application, I am utilizing spring-security and jQuery. The main page loads content dynamically into tabs through Ajax. Everything seems to be functioning correctly, but occasionally the login page pops up inside one of the tabs. When I enter my cred ...

Out of the blue, my session stopped functioning

I am encountering a major issue with sessions. I am working on developing an application using "Redis" in node.js along with various libraries such as express. However, I have run into a problem where the sessions are no longer functioning properly. Desp ...

Display the most recent files that have been uploaded via the $_FILES variable

Current Progress: Successfully implemented a system to upload multiple images simultaneously. The workflow is as follows: upload.php: Displays an HTML form for users to select and upload desired images. upload-script.php: Called by upload.php, this scrip ...

In production, Express-Session fails to persist

My nodejs application is encountering issues with express-session when running on gcloud production, although it works perfectly in my local development environment. app.js var express = require('express'); var path = require('path') ...

Save the socket.id from Socket IO into the Express session

Currently, I am working on a web application that utilizes Angular and Express. To handle database updates, I have implemented a REST API and incorporated SocketIO for real-time client updates. I have managed to track a list of active socket IDs for each ...

Challenges in verifying user identities and maintaining session continuity in passport.js/Node.js

Currently, I am in the process of setting up passport for authentication on my node.js web application. However, I am encountering some difficulties with properly storing session data. Right now, it seems like the session data is not being stored at all. ...