Questions tagged [session]

18054 questions
0

votes
1

answer
11

Views

PHP session has already been started

I have a page on my website that calls a php file using ajax. I require the user to be logged in to access either page, and use session_start() on the page that calls the php file (let's say main.php calls bg.php). I include a session_start() on bg.php as well, because I need to access the session v...
k97513
1

votes
0

answer
13

Views

Spring Boot 2 - Session Issues

My security config reads like this: protected void configure(HttpSecurity http) throws Exception { http .antMatcher('/**') .authorizeRequests() .antMatchers('/*.js', '/*.ico', '/*.png', '/*.css').permitAll() .anyRequest().authenticated() .and() .formLogin() .loginPage('/login') .loginProcessingUrl('...
Magd Kudama
0

votes
0

answer
12

Views

how to login using email stored in session storage

my if and else won't work and they don't seem to be getting information from my session storage i tried to manually login without the use of the for loop but it wouldn't work. i tried to change the values of the variables and tried to encode info to the storage var records=[]; function saveRecordsTo...
blebloeblu
1

votes
5

answer
1.4k

Views

Top use cases for using Sessions in Java web application

I've been always trying to avoid using Sessions. I've used spring security or other ways of having user logged in the application, which is I suppose the major use case for using Sessions. But what are the other use cases ? Could you please make a list of those most important ones ? How come that I...
lisak
1

votes
1

answer
2.7k

Views

How do I create a session variable in Python?

I use Python 3 as a serverside scripting language, and I want a way to keep users logged into my site. I don't use any framework, since I prefer to hand code pages, so how do I create session variables like in PHP in Python 3?
Orcris
1

votes
1

answer
3.3k

Views

Routing Error: uninitialized constant Sessions

I'm following this Ruby Railcasts episode to get some simple auth going, and I'm getting the error uninitialized constant Sessions when I navigate to the login page. I've checked my classes and the names are proper, which seems to be the problem most people report. Any idea what might be happening h...
8vius
0

votes
0

answer
2

Views

Can tensorflow Session.run() return memory address to variable rather than a copy

I'm using TensorFlow to train a deep neural network. Python interacts with TensorFlow via Session, which outputs the results. In my case, I want to return the weights of my network, use them to process my data externally (i.e. outside tensorflow), and then pass the weights back to tensorflow to upd...
python_freak
1

votes
0

answer
11

Views

Node.js - How to send sessionID to GET method in Express via request package?

I'm trying to login to my Node.js (Express) app with another Node.js created script to try create a virtual bot on my app. First, i sent a POST via 'request' package to my /api/user/login and then i tried to get data from /api/user/session where i must be logged. Request script: request.post({ url:...
Hellbyte
1

votes
1

answer
9.2k

Views

Destroy PHP Sessions on Browsers Tab Close

i am stucked, i am working on Projects hotbartendersla i have used a lot of sessions to process data in event booking, now i want to destroy the session when user closed the window/tab of browser,because when ever i open site the selection remains same as i did. i have used this window.onbeforeunlo...
Engr Zardari
1

votes
1

answer
1.2k

Views

Spring boot basic authentication spring boot session possible

I have a spring boot back-end server application that implements basic authentication over https. Will not have a traditional web based front end, rather my android and IOS clients will be using Rest API calls. The backend application is currently validating the username and password information...
geezer57
1

votes
3

answer
6.3k

Views

PHP Session Array list

How can I print a list of session arrays with php? I have this php code: foreach($wall as $v) { $_SESSION['nickname'] = $v['user']['nickname']; $_SESSION['imageURL'] = $v['user']['imageURL']; $_SESSION['clubURL'] = $v['user']['clubURL']; $_SESSION['id'] = $v['id']; $_SESSION['date'] = $v['date']; $...
Carlos Martins
1

votes
2

answer
4.1k

Views

Dynamic session array remove specific element

So I am trying to remove a specific element from my dynamic session array. My current array removes the wrong element and leaves the element I wish to get rid of sku = 'the_item_value' sessionArray = session('cart') Dim length : length = Ubound(sessionArray) sessionArray(length-1)=sku ReDim Preserve...
kqlambert
1

votes
0

answer
1.8k

Views

PHP session not working on docker

I am trying to set up a PHP application but something seems to be wrong with session handling. As you can see the configuration is quite standard. I checked the /tmp permissions from the container and got [email protected]:/# ls -ld /tmp drwxrwxrwt 1 root root 4096 Dec 28 08:03 /tmp I also checked...
Moby04
1

votes
1

answer
302

Views

CSRF - sending ajax requests to get token

I am developing CSRF protection for my website. I am saving token in hidden input in form + session, then i check if they're equal. I am just wondering about this scenario : user visits malicious website malicious website sends ajax GET request to get page with form and extracts token from it malic...
Tadeas J
1

votes
0

answer
54

Views

Express Node.js client-sessions throwing error of undefined

I am trying to set a cookie session using client-sessions. I think everything should work. but it is giving me the error [TypeError: Cannot read property 'isAdmin' of undefined]. I am failing to see what I am doing wrong. Thanks in advance! var session = require('client-sessions'); app.use(session({...
Cory Sparks
1

votes
0

answer
66

Views

asp.net mvc session less application, how to pass data between two action

We are working on session less asp.net mvc application. We have a requirement in which we have to pass data between two actions. our application is deployed on multi-server. so I can't be able to use TempData. As well TempData uses session itself. so that the other reason that I can't use TempData...
Fahad Farooqi
1

votes
1

answer
203

Views

Echo is not clearing the session

I am using Echo for my web application. I tried to implement Login and Logout. When I tried to logout, its not clearing the session. Here is my code: func Logout(c echo.Context) error { sess, _ := session.Get('session', c) sess.Options = &sessions.Options{ Path: '/', MaxAge: -1, HttpOnly: tru...
pyprism
1

votes
1

answer
134

Views

Saving a data URL from Javascript in PHP through Ajax

For my project I need to save what's displayed on a canvas to a database. I am now quite familiar with the toDataURL() function, and the code below (essentially just a test) works, displaying the image twice. var canvas = document.getElementById('canvas'); var image = new Image(); image.src = '03Jun...
Stick_Giraffe
1

votes
0

answer
18

Views

Negative Impact of Turning Off Kernel Caching?

In effort to prevent session swapping, we are thinking of turning off Kernel Caching in our ASP.NET web forms app. I've been reading all about this, like here, and here. But what I'm not seeing anything about is what kind of user-experience impact this may have. Should we expect page load times t...
Casey Crookston
1

votes
0

answer
298

Views

How to reduce amount of session locks in Cm_RedisSession_Model_Session::read

I have a question about Cm_RedisSession Module for Magento. It has built-in locking algorithm. Method code can be found here: https://github.com/colinmollenhour/php-redis-session-abstract/blob/4671d63212fe05802f21d2fe3086f3425900483e/src/Cm/RedisSession/Handler.php#L401 I get around ~10 failed lock...
Vladimir Samsonov
1

votes
1

answer
891

Views

Jsch 0.1.54 session.connect() throws com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: End of IO Stream Read

I use he below code to connect to the ssh server. JSch jsch = new JSch(); Session session = jsch.getSession('username', 'ip', port); Properties config = new Properties(); config.put('kex', 'diffie-hellman-group1-sha1'); config.put('StrictHostKeyChecking', 'no'); session.setConfig(config); session.se...
Sreeraj
1

votes
0

answer
121

Views

Spring session with redis - lost Principal

guys. I migrated to Spring session with Redis implementation. I'm using spring boot and the only thing that i've made to start with this implementation is to add this org.springframework.session spring-session-data-redis org.springframework.boot spring-boot-starter-data-redis in pom.xml and this in...
ROZZ
1

votes
1

answer
42

Views

Trying to write a function that uses a session variable

I'm trying to write a function that takes the current user's username (as either a session variable or a GET or POST parameter) and displays private content (id and filepath) that this user can view because it's shared with a group to which this user belongs. Here's what I have so far, but I seem to...
sql_injector
1

votes
1

answer
48

Views

What are the practical use of setting more than one PHP cookie in a client side

I have a vague understanding of the relationship between a session and cookie(s) in php. From my understanding cookie is supposed to aid implementation of session for a client at the server side, But I need clarification on some experiment I conducted today. ?> If I supply a value 'foo' into session...
Ndifreke Ekim
1

votes
1

answer
232

Views

Laravel 5.4 Session removing variable on page reload

class LoginController extends Controller { public function processLogin(LoginRequest $request) { $email = $request->get('email', ''); $password = $request->get('password', ''); $token = $this->_loginService->processLoginAttempt($email, $password); Session::put('access_token', $token); Session::save(...
Tanaka
1

votes
0

answer
29

Views

Session Sharing on Firefox

I'm using this code on Firefox 57 Web Extension to create a new tab in Firefox 57 let mirror = browser.windows.create({ url: profiler.url + '?profiler=' + i, state: 'fullscreen' }); mirror.then((docking) => { let updateInfo = { left : x, width : screen.width, height : screen.height }; browser.w...
Yohanes AI
1

votes
1

answer
601

Views

JavaScript alternative to Python requests.Session()

I have recently developed a Python API for a chatbot and made a demo using a quick python script: s = request.Session() user_response = None while True: chat_response = s.get(url='http://localhost:5000/chat', json={'user_input': user_response}).json() if chat_response['is_end']: break if 'text' in r...
Matthew Jackson
1

votes
0

answer
427

Views

Spring Security SessionRegistry returning empty list

Friends I have search a lot and try every solution available on the internet, but my problem not solved. I want check (in Spring Boot web application) currently user logged in with the credentials specify in the login page, if there is a session with username currently, then invalidate that first a...
Mandy
1

votes
0

answer
282

Views

How to set session attributes using RestAssured for Integration Tests

I have a AbstractClass and this class has following code: protected long getStudentIdFromSession() { Object obj = this.httpSession.getAttribute('studentId'); Long formId = (obj instanceof Long ? (Long) obj : null); LOGGER.info('getStudentIdFromSession studentId {}', studentId); return formId; } I am...
dvanga
1

votes
0

answer
476

Views

Spring Boot with Embedded Tomcat: Session not persisting through restart

The research I've done on this seems to indicate that this should happen automatically. Some writings suggest that it is required to place server.session.persistent=true inside src/main/resources/application.properties. I have done this and I believe sessions are still not persisting. Some backgro...
user1445967
1

votes
2

answer
156

Views

Symfony: how to separate Users/Sessions for Frontoffice and Backoffice

I have a project with Frontoffice and Backoffice in the same application. Backoffice is separated with ^/admin/ in URL. Backoffice needs to have Administrator object as logged in User and Frontoffice needs to have Member object as logged in User at the same time. Is there a way to have separate Sess...
Crence
1

votes
1

answer
35

Views

How to connecting to the remote site with CURL and header location

I am logging from site A through CURL on site B, I get the cookies from the connection and write to file called cookie.txt. But when I pass the cookie data to do the final header redirection ('Location: http://examplesiteb.com'), it returns disconnected. The code I am using for connection is the sam...
SourceForge
1

votes
1

answer
442

Views

Data not storing in localStorage in Angular 5

Hello internet people, I am trying to make an Angular 5 application with Mongoose as the back-end. Now I want to store data (an authentication token) in localStorage so that users keep their auth token after closing the page. This token is used to access our Mongoose endpoints. When we try to acces...
Max Koning
1

votes
1

answer
571

Views

Python3.6, ftp_tls and session reuse

So, I'm struggling trying to upload a file to a remote ftps server that requires session reuse. I must specify that even if I can connect to the server without problems via Filezilla, I get the error 'unknown server certificate'. This is my script: import ftplib import ssl USER = 'username' PASS = '...
Ministry
1

votes
1

answer
44

Views

Is there a way to persist an ELB stickiness session even if the instance its connected to fails?

Just curious if this is possible or how you would accomplish this. Regardless if I use duration based stickiness or application based, when the instance a user is connected to fails their session gets reset because they have to connect to a new server. Is there a way to not have this happen? To be a...
red888
1

votes
0

answer
171

Views

Session is NULL Memcached - Codeigniter + Ratchet

I have just installed Memcached and used some tutorials to set up the server. This is my code for the server: use Ratchet\Session\SessionProvider; use Symfony\Component\HttpFoundation\Session\Storage\Handler; require dirname(__DIR__) . '/vendor/autoload.php'; $loop = React\EventLoop\Factory::creat...
Jianov
1

votes
1

answer
48

Views

Symfony 2.8 functional testing - add values to the session array

I'm having a controller which reads an integer from the session array in this manner: if ($session->has('administration')) { $id = $session->get('entity_id'); return $this->getDoctrine()->getRepository('AppBundle:SomeEntity')->find($id); } Currently I'm writing tests for this controller action but I...
markvdlaan93
1

votes
1

answer
88

Views

Passing Session Variable with Ajax and iframe does not work

I´m trying to pass a variable from a Page (values of a form) to a php page via a session. Between that I have an iframe that opens another html page after the form is sent and makes an ajax request to the php page but it always fails and gives me this: Notice: Undefined index: Flightnumber1 Notice:...
Deadpool
1

votes
2

answer
34

Views

php session destroy issue in specific server

I am creating 3 sessions and destroying with proper functions. However it throws weird issue to me where in Internet explorer, it doesn't destroy session, in firefox and chrome, I have to refresh the page twice. Here is the simple code I am using to check: login.php (This is to create sessions) if(i...
Dhaval
1

votes
2

answer
27

Views

Session Data overwriting in a two page form PHP [closed]

To register a user, I am using a form that consists of two pages. the first form(addUser.php) sends the data over post to the second form(plz.php). In the second form I save the post values from the previous page in session variables, for example $_SESSION['phone1'] = $_POST['telnr']; I have checke...
ev_3

View additional questions