Questions tagged [session]

A session refers to all the requests that a single client makes to a server. A session is specific to the user and for each user a new session is created to track all the request from that user.

Filter by
Sorted by
Tagged with
4
votes
0answers
232 views

SQL-Alchemy session management

I have written a couple of scripts for accessing Twitter REST API, and storing data in a Postgres DB for data extraction purposes. I know how to use django ORM, or plain SQL, but this was my first ...
6
votes
2answers
533 views

Browser-based Mafia game in PHP

Because I'm rather new to PHP and Object Oriented Programming, I'm often looking for some practice. Thus I decided to focus on making a browser-based Mafia game that should work like a Dutch variant: ...
1
vote
1answer
1k views

Hardcoded PHP Login

I am reviewing previous undocumented php work from a predecessor on these two scripts to manage access to an administrative dashboard, but I'm not sure about vulnerabilities and other things that ...
9
votes
2answers
473 views

Making a simple session class more secured

I just wrote the session class below. I humbly request for a review on how to make this even more secured/ how sessions are normally written. The code below works, but I would love to make it even ...
1
vote
0answers
66 views

Implementing internationalization functionality for online English lessons

My website purpose is to sell online English lessons to people in Europe. It is crucial that my site is multilingual. Overview I am using HMVC modules to organize my site and my website has four ...
8
votes
5answers
754 views

Securely handling a password protected application

I have some small applications that I want to secure. I've been using the following setup that I think is fairly safe, but I've never been able to set my mind at ease that it really is. Could you ...
3
votes
1answer
1k views

PHP login and session establishment

I would like to ask your advice on my simple code to login and registration sessions. In the User class, login function: ...
1
vote
0answers
357 views

Concurrent SSH session pool

In my application I need to perform several SSH commands from Windows to a Linux machine. Since I need to reduce as much as possible the SSH calls overhead and also limit the number of concurrent ...
0
votes
1answer
3k views

Secure logout PHP code with cookies

I have the following PHP logout script and I would like to know the loopholes present in it. How can I improve it? ...
1
vote
1answer
69 views

Class for creating save sessions in PHP

Is the following class well-built and secure or am I missing something? Any improvement ideas welcome. ...
2
votes
1answer
210 views

Cookie wrapper made for fun

This was mostly made for fun, so I don't see it having any real world purpose any time soon. ...
1
vote
0answers
530 views

Alternative session token implementation in flask

Here is my implementation of an alternative session token. The idea is to reset session_token every time get_id is called, so (I ...
5
votes
1answer
5k views

Session handling using Python Requests client

I'm using this code to login to an experiment login system created by me for this purpose. ...
4
votes
1answer
195 views

Cookie, Session, and Flash middleware for Iron framework

Iron's cookie and session middleware projects seem to be abandoned. I've put together implementations for them, along with a ...
5
votes
1answer
233 views

Very basic PHP session handling

I’ve got my first real PHP web application up and running. It is working as expected, but being my first time, I’m sure there is plenty of room for improvement. Right now, there is one particular ...
3
votes
2answers
85 views

Find existing session

I have this method in my rails app: ...
1
vote
0answers
388 views

Session wrapper for PHP that supports alternative session handlers

I'm developing a session wrapper for the next version of a framework that I've been working on for the past few years. I want to support a variety of PHP session handlers. Laravel's session package ...
6
votes
2answers
40k views

Login system with session using CodeIgniter

I implemented a login system, with session, using CodeIgniter. If the session doesn't exist, redirect to login page. Please review, and let me know what can be done to make it better. view (login.php)...
2
votes
0answers
115 views

FlowRouter auto-redirect on login page

The site should be accessible only to signed-in users. I'm making sure I publish and enable data manipulation to only those, but I wanna make sure even the app structure won't be visible. What I did ...
3
votes
1answer
5k views

Login system using a persistent cookie

I want to be sure that my code below properly secures the website based on all of the information provided. Login System Overview When a user logs in, the following user info is saved to a ...
2
votes
2answers
658 views

Using session wrapper for accessing session data

When users log in to our website, we store some information in a session to retrieve it across the site. We created a few wrappers to help with data retrieval/storage to lessen duplication of code. I'...
2
votes
1answer
6k views

Session expiration handler using PHP and jQuery

At this point i am interested to see other techniques on handling session timeouts. What are some good improvements on this script to detect when a session is no longer valid? Important definitions: ...
1
vote
2answers
80 views

Logging out users securely

Is there anything I need to add or is this the best security possible? ...
2
votes
0answers
572 views

Add transactional Units of Work to incorrect NHibernate usage (microsessions, single object actions)

This code is part of a quite huge repository using NHibernate in a wrong way: no units of work, but microsessions for every object loading and saving (ignorant of Persistence Ignorance, coded like ...
5
votes
1answer
1k views

PHP login script security check

I made an admin login script for my own CMS website that I'm making in Code Igniter 2.2.1 and I'd like to know what are the potential threats or some holes that I might have left open. This is how it ...
4
votes
1answer
4k views

Persistent login (“remember me” cookie) using PHP

The code below is a attempt to create a persistent login cookie. I am an amateur and not professional so this is the first attempt to have secure remember me cookie. Now I want you guys to review two ...
4
votes
1answer
526 views

Restart Citrix session using locally stored application

I have a Windows forms application which we deployed in my firm for use on thin clients. The app lives locally on each user's machine, but pretty much all of the work the users do is over a Citrix ...
2
votes
2answers
194 views

Many nested session verification conditions

Can someone give me advice on cleaning this code? It's more messy then I expected. I got like 10-15 more ifs to be added. I've thought of adding the error messsages in methods and then just check if ...
5
votes
1answer
503 views

Database Session Class

I have made the decision to move the storing of session data from the filesystem to the database. Our application is growing at pace and we are having issues with the load balancer breaking the ...
4
votes
1answer
2k views

login_required decorator in Flask

I have 2 Flask apps (different projects) that work together . One implements some API which uses tokens for auth. The second one consumes the API and makes a web interface for it. Now I have a login ...
3
votes
1answer
179 views

Basic login script for educational purposes

I have created a login script to demonstrate the usage of sessions in PHP. The focus is not on security, databases or encryption. The idea is to exemplify how you can use sessions to protect pages ...
1
vote
1answer
133 views

Social football site with authentication and user statistics

It works and does what is supposed what to do btw. ...
4
votes
2answers
5k views

Session Wrapper

I have two types of session wrappers: Type 1 ...
1
vote
1answer
562 views

Another PHP login handler

I wrote this class to handle login sessions for a framework I'm writing for educational purposes. My major areas of concern: Style I know my style is a little contrary to most coding conventions. ...
2
votes
1answer
49 views

Authentication and session creation

My session controller has a method for creating new user session. According to Rubocop's output there is 'Assignment Branch Condition' metric is too high [15.17/15]. ...
9
votes
3answers
34k views

First PHP login system

This is my first attempt at a login system! I've only had roughly 2 days of experience with MySQL and PHP so far and this is what I came up with: ...
3
votes
1answer
781 views

Session flash class

I've created this class, for flashing variables like validation errors or success messages. But I'm not certainly sure about it. ...
4
votes
1answer
79 views

Session manager for logged in users

I wrote this code to handle logged in users. The session IDs will be stored in cookies. I would like to know if it's usable or if there are security problems. It uses a 64bit id and another 64bit ...
2
votes
1answer
4k views

Using $_POST and $_SESSION - passing variables between pages

I have an index page which gets passed $_POST['timestart'] and $_POST['timeend'] variables. In addition, I have a cart page ...
1
vote
2answers
4k views

Saving data to a session

I'm a bit confused if saving the information to session code below, belongs in the controller action as shown below or should it be part of my Model? I would add that I have other controller methods ...
2
votes
2answers
931 views

Session Handling Setup

Just wanted to run through my PHP session handling and get some feedback and tips with regard to what is good (if anything!), what could be better and what is either plain wrong, or using out of date ...
1
vote
2answers
264 views

PHP session_set_saver_handler with session timeout

I have developed a class that utilises the session_set_saver_handler function so I can store sessions within my DB. The class works just as I would like. However, ...
1
vote
0answers
2k views

Handling user permissions in Code Igniter

I haven't done much work with Code Igniter, and can't seem to get much of a definitive answer poking around as to what the best solution to this problem is. Before moving forward, I wanted to see if ...
1
vote
1answer
96 views

Login and User Information Requests

This code basically connects to a database, sets login success and failure pages, queries the database for user details, checks if user is active, sets session value and redirects accordingly. Can ...
3
votes
1answer
167 views

Custom session handler

I'm new to PDO and haven't been coding in a while. Is the following custom session handler industry-acceptable? ...
3
votes
1answer
73 views

Cross-site request forgery defense for code to count Likes

I have the following code which is supposed to insert a row into a DB table "clicks" (consisting of 1 Primary AI column "id" and another column "user" which contains the user's session ID) upon ...
2
votes
1answer
563 views

Custom Session Pool

We use a student information system called Colleague that is developed by Ellucian. As far as I can tell, the system does not use any sort of session pool so rapidly opening and closing connections ...
2
votes
2answers
169 views

Browser game project

I am working on a little browsergame project written in PHP and using PostgreSQL as DBMS. Now I'm not really lucky with the process started after a userlogin was successful. Some info: There are 3 ...
1
vote
0answers
70 views

Persisting database row ID between controller actions on a multi-step “create item” form

I have a form on an anonymous site which has 3 steps. A user submits each step individually, in sequence (1-2-3). BUT, step 1 creates a new table row, while steps 2 and 3 only update the existing row (...