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
233
votes
9 answers

PHP Pass variable to next page

It seems pretty simple but I can't find a good way to do it. Say in the first page I create a variable $myVariable = "Some text"; And the form's action for that page is "Page2.php". So in Page2.php, how can I have access to that variable? I know I…
Carlo
  • 25,602
  • 32
  • 128
  • 176
223
votes
14 answers

Chrome doesn't delete session cookies

I'm trying to set session cookie in javascript like this: document.cookie = 'name=alex; path=/' But Chrome doesn't delete it even if I quit browser and launch it again. I checked in Firefox and Opera and both work as intended - they delete session…
mgs
  • 2,621
  • 2
  • 19
  • 14
212
votes
17 answers

What is the proper way to re-attach detached objects in Hibernate?

I have a situation in which I need to re-attach detached objects to a hibernate session, although an object of the same identity MAY already exist in the session, which will cause errors. Right now, I can do one of two…
Stefan Kendall
  • 66,414
  • 68
  • 253
  • 406
202
votes
5 answers

How to set session timeout in web.config

I have tried very hard but cannot find a solution on how to set session timeout value for in-process session for an ASP.Net web application. I am using VSTS 2008 + .Net 3.5 + C#. Here is what I wrote by myself to set timeout to be 1 minute, is it…
George2
  • 44,761
  • 110
  • 317
  • 455
193
votes
8 answers

PHP: Storing 'objects' inside the $_SESSION

I just figured out that I can actually store objects in the $_SESSION and I find it quite cool because when I jump to another page I still have my object. Now before I start using this approach I would like to find out if it is really such a good…
markus
  • 40,136
  • 23
  • 97
  • 142
189
votes
4 answers

NHibernate ISession Flush: Where and when to use it, and why?

One of the things that get me thoroughly confused is the use of session.Flush,in conjunction with session.Commit, and session.Close. Sometimes session.Close works, e.g., it commits all the changes that I need. I know I need to use commit when I have…
Jon Limjap
  • 94,284
  • 15
  • 101
  • 152
183
votes
7 answers

How to change the session timeout in PHP?

I would like to extend the session timeout in php I know that it is possible to do so by modifying the php.ini file. But I don't have access to it. So is it possible to do it only with php code?
Oli
  • 15,935
  • 7
  • 50
  • 66
182
votes
15 answers

Session timeout in ASP.NET

I am running an ASP.NET 2.0 application in IIS 6.0. I want session timeout to be 60 minutes rather than the default 20 minutes. I have done the following Set in web.config. Set session timeout to 60…
klone
  • 2,005
  • 2
  • 16
  • 18
170
votes
2 answers

How to join two tmux windows into one, as panes?

I have two tmux windows, with a single pane in each, and I would like to join these two panes together into a single window as a horizontal split panes. How could I do that?
RNA
  • 146,987
  • 15
  • 52
  • 70
170
votes
10 answers

Session variables in ASP.NET MVC

I am writing a web application that will allow a user to browse to multiple web pages within the website making certain requests. All information that the user inputs will be stored in an object that I created. The problem is that I need this object…
Draco
  • 16,156
  • 23
  • 77
  • 92
167
votes
22 answers

Laravel - Session store not set on request

I recently created a new Laravel project and was following along the guide on Authentication. When I visit either my login or register route, I get the following error: ErrorException in Request.php line 775: Session store not set on request. (View:…
mattrick
  • 3,580
  • 6
  • 27
  • 43
166
votes
39 answers

PHP session lost after redirect

How do I resolve the problem of losing a session after a redirect in PHP? Recently, I encountered a very common problem of losing session after redirect. And after searching through this website I can still find no solution (although this came the…
dayuloli
  • 16,205
  • 16
  • 71
  • 126
163
votes
8 answers

Do AJAX requests retain PHP Session info?

If I had a user logged onto my site, having his id stored in $_SESSION, and from his browser he clicked a 'Save' button which would make an AJAX request to the server. Will his $_SESSION and cookies be retained in this request, and can I safely rely…
Ali
  • 261,656
  • 265
  • 575
  • 769
162
votes
6 answers

Can you help me understand this? "Common REST Mistakes: Sessions are irrelevant"

Disclaimer: I'm new to the REST school of thought, and I'm trying to wrap my mind around it. So, I'm reading this page, Common REST Mistakes, and I've found I'm completely baffled by the section on sessions being irrelevant. This is what the page…
Rob
  • 25,984
  • 32
  • 109
  • 155
162
votes
7 answers

Forms authentication timeout vs sessionState timeout

I have code that i am looking through regarding session time outs of the website. In the web.config i came across this code.
Lucky Luke2
  • 2,056
  • 5
  • 25
  • 32