session

Using a form token when user isn't logged in

I noticed that a lot of sites send a random token with form posts even though the user is not logged into a service requiring authentication. I understand the use of a token when you have an authenticated session, but what is the point in sending one when they aren't authenticated? Is it common practice to create a session when a user ...

User roles - why not store in session?

I'm porting an ASP.NET application to MVC and need to store two items relating to an authenitcated user: a list of roles and a list of visible item IDs, to determine what the user can or cannot see. We've used WSE with a web service in the past and this made things unbelievably complex and impossible to debug properly. Now we're ditc...

OAuth's tokens and sessions in REST

The other minute I read an article on OAuth. It described especially the tokens being exchanged between client and service provider during a series of requests. The article also mentioned that OAuth gains significant popularity in RESTful APIs as authorization layer. As I understood, REST should be kept completely stateless. The questi...

How do I check that a session object contains a particular key/value entry

I want to check if a certain key/value pair has been set. How do I check if a an entry with key named "keyName" exists. Sample code or a pointer to an example would be appreciated. ...

How do I share data between a jsp page and servlet

I have several .jsp pages and several servlets. I need to save some information to a session variable. In the jsp page I simply refer to session.get...() or session.set...() Without explicitly declaring an HttpSession object. But in the servlet the proper rules of programming apply and I have to create an object first. My conc...

Zend Sessions: Dealing with http://www.domain.com vs. http://domain.com

What's the best way to handle this? When a user logs in a domain.com, they are logged out on www.domain.com and vice-versa. Should one always be rewritten to the other with mod_rewrite? What is the best practice here? ...

Ruby - Ajax: update session value when clicking on a link

I have this ruby function in a controller def updateSession value case value when 1,2 session[:value]=1 when 3,4 session[:value]=2 end end And I have different links that redirect to different pages. I would like to change the session value when clicking on those links by calling the updateSession function Is it...

issue with php sessions

i cant seen to get the php sessions to work, im trying to create a form that saves the data then put its against regular expressions to verify its legit information. at the moment im trying to figure out how to get the sessions to register but i cant figure it out, please help. im new to sessions <?php session_start(); ?> <!DOCTYPE HT...

How do I create a session in Catalyst?

Trying to figure our how to create, store and retrieve session info in Catalyst. Any suggestions? ...

how to Intialize the object as a static only for one session

I am working with ASP.net 3.5 MVC application. I have one assembly which has ClassA. I have another assembly which creates the object of ClassA Now the question is , how to Intialize the object as a static only for one session. The object will be static across the session. New Instance of the object should be created only when new sess...

ASP.NET is there a way to save application state as session state on different server ?

Hi, maybe the question is wrong but here is what i want to achieve maybe there is other way to do that. I have ASP.NET application running .net 3.5, there is a client list and few others List based objects that are shared among all users of application. ie. when client logged in his userID and few other properties are saved within some ...

PHP Session is not destroying after user logout

I'm trying to create an authentication mechanism for my PHP Application and I'm having difficulty destroying the session. I've tried unsetting the authentication token which was previously set within the session array and destroying the session through session_destroy, as well as resetting the session array completely before destroyi...

Accessing Zend Session data between actions

Hi. Here's my problem - I'm trying to access a session namespace across actions. The ZF examples appear to work by generating NEW namespaces, but they only demonstrate this within one action - but how do I access an existing namespace from a separate action? Here's the code: public function indexAction(){ $defaultNamespace = new Ze...

asp.net: Individual Session Variables vs Object Saved in Session

We have various related session variables for a complex page that has various things going on. Currently these session values are individual page properties (Guid, String, Integer etc). If I had a serializable object with these properties and saved this in the session, would it be more efficient? ...

Does Session.Remove() clear memory in c#?

I am using a Session variable to pass a datatable from 1 page to another. Sometimes the datatable can contain well over 100,000 records. After running it a few times, I get thrown a Out of Memory exception, so I guess I have a few questions? Is Session the best way to handle this? Does Session.Clear("session") release it from Memory?...

Provide strongly typed access to the session object

What is the best way to provide strongly typed access to the session object? I am planning on turning on Option Strict, which is causing the compiler to complain about my lazy programming technique of directly accessing the session object: Dim blah As Integer = Session("Blah") My initial thought is to create a class that wraps the se...

Can I get the size of a Session object in bytes in c#?

Is it possible to get the size(in bytes) of a Session object after storing something such as a datatable inside it? I want to get the size of a particular Session object, such as Session["table1"], not the whole Session collection, so the other question, while helpful, is not quite a duplicate. ...

Why does FileSystemWatcher reset our website sessions?

We have an ASP.NET 2.0 website with an advanced configuration that is not catered for by a standard Web.config. Instead we're storing the config in our own Xml schema in the /bin/ folder, and we have a singleton object which caches this config and uses a FileSystemWatcher to detect updates. This logic sits in a separate class library whi...

not understanding why this code is not working...

im new to sessions but from what i see it complicated to apply <input> with them. can you please look at this code and tell me why its not working. i had it working earlier then it died on me. the function of the program is to fill out a form and have it verified for legit information using regular expressions, i just need help with get...

How to store object (not string) in session in play framework?

I have a project for school and I have to use Java. Recently I found play framework and I want to try to use it. It's easy enough for a quick start, but I ran into a problem with session. Being stateless by its nature, play sends entire session to user in cookie and receives it on next request, so it allows only limited amount of data i...