Questions tagged [session]

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

From Wikipedia:

A session is a semi-permanent interactive information interchange, also known as a dialogue, a conversation or a meeting, between two or more communicating devices, or between a computer and user (see Login session). A session is set up or established at a certain point in time, and torn down at a later point in time. An established communication session may involve more than one message in each direction. A session is typically, but not always, stateful, meaning that at least one of the communicating parts needs to save information about the session history in order to be able to communicate, as opposed to stateless communication, where the communication consists of independent requests with responses.

An established session is the basic requirement to perform a connection-oriented communication. A session also is the basic step to transmit in connectionless communication modes. However any unidirectional transmission does not define a session.

References:

44567 questions
9
votes
5 answers

Securing an ajax request

i have a website that uses session cookies for security. it works fine and all, but any ajax requests right now are not secure. example being lets say a user is on a page. they can only get to this page if they are logged in with a session - so far…
asdasdsa
  • 91
  • 1
  • 2
9
votes
2 answers

How to create and destroy session in Spring REST Webservice called from Mobile client

I have Spring REST webserivce Now from a mobile client webservice is getting called. First, login method is called for log in succes or failure based on sent value userid and password. @RequestMapping(value = "/login", method =…
Pan
  • 101
  • 2
  • 2
  • 7
9
votes
1 answer

Laravel maintain a Session in subdomain of different server

Suppose in a domain (app.domain.com) I have set a Session like this: Session::put('test', 'value'); Then in different domain (ex. news.domain.com) I want to retrieve that session value. Note that the other domain is located ON DIFFERENT SERVER, but…
user2002495
  • 2,126
  • 8
  • 31
  • 61
9
votes
2 answers

Difference between setting session timeouts using web.xml and setMaxInactiveInterval

I have a requirement where a user is authenticated into a session and after 10 minutes of inactivity, the session times out. Once the session times out any further requests from the now expired session is redirected to a timed out page. I have…
Sai
  • 1,889
  • 5
  • 18
  • 26
9
votes
1 answer

Best practice with sessions (gorilla/sessions)

Before starting using sessions in golang I need answers to some questions session example import "github.com/gorilla/sessions" var store = sessions.NewCookieStore([]byte("33446a9dcf9ea060a0a6532b166da32f304af0de")) func Handler(w…
clarkk
  • 27,151
  • 72
  • 200
  • 340
9
votes
2 answers

login sessions for django

I'm trying to set login sessions within my web app but can not get it to work. I'm new to django and read the documentation for sessions but not making the connection to my web app. All I want from it at the moment is to check if a user is logged in…
Chris Meek
  • 1,473
  • 5
  • 20
  • 31
9
votes
3 answers

Why does Java class library still use String constants in place of enum

I am using a few Java classes like javax.Mail.Session and MessageDigest for a tool I am building. I noticed that it was difficult assigning them properties because they were using String constants for that. For example, for a Session object, you…
Rajan Prasad
  • 1,582
  • 1
  • 16
  • 33
9
votes
2 answers

Is session_unset() deprecated?

In the PHP documentation for session_unset() there is no hint that this function is deprecated so I think it's fine to use it. But then I read through the documentation about session_destroy() where I found this hint: Note: Only use…
TiMESPLiNTER
  • 5,741
  • 2
  • 28
  • 64
9
votes
2 answers

Creating temporary user accounts - Django

I need to setup temporary User models for each visitors, where the visitors are obviously tied by session data. I might not be aware of it, but does Django support attaching data to Anonymous users? The only way, I am currently aware of, is to use…
RadiantHex
  • 24,907
  • 47
  • 148
  • 244
9
votes
1 answer

When should I use PHP Session vs Browser Local Storage vs JavaScript Object Parameters?

When is it appropriate to use the many different ways that modern day AJAX based applications are storing data? I'm hoping for some specific guidelines that I can give developers. Here's what I'm seeing so far, and it's getting messy. PHP Server…
jjwdesign
  • 3,272
  • 8
  • 41
  • 66
9
votes
5 answers

PHP, nodeJS and sessions

I have an classical apache server delivering php files, and a nodeJS server (with socket.io, but whithout express/connect) used for real-time event management on that PHP website. I sometimes need to authenticate the clients connecting to the nodeJS…
Magix
  • 4,989
  • 7
  • 26
  • 50
9
votes
5 answers

Where I should declare a session variable in asp.net

I am building a Asp.net Application. I need to save a HashTable in a session. At page load i am writing protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Session["AttemptCount"]=new Hashtable(); //Because…
Vaibhav Jain
  • 33,887
  • 46
  • 110
  • 163
9
votes
2 answers

Viewing session variables in browsers

This might be a silly question with an easy answer, but I cannot seem to find any info on it. I am creating a webapp for a clients intrant, and I am using session variables, which start as they log in. EG: Session["ConsultantFirstname"] =…
Fizor
  • 1,480
  • 1
  • 16
  • 31
9
votes
2 answers

How is HttpOnly get set for ASP.NET_SessionId cookie?

In my web project setting to turn on httpOnlyCookies is not there. It is false by default. Also there is no place in code where cookie is being set to HttpOnly. However, when I browse to the site I can see that ASP.NET_Session cookie is being…
dev.e.loper
  • 35,446
  • 76
  • 161
  • 247
9
votes
5 answers

Creating a new session after authentication with Passport

I've created a simple Authentication application with passport (see code below). Express through the session middleware, creates a session on every request where the requesting client does not have a session already. I'd like to assign sessions only…
Georges Krinker
  • 2,259
  • 4
  • 25
  • 24