session

Sessions in web pages. How to log out automatically

When we sign into gmail in one tab and orkut in another(remember both can only be of the same account. Logging into one automatically logs into another). if we log out from gmail and then go to the tab in which orkut is already open, after remaning in the page for a few seconds the page automatically logs out. How is this done? i assu...

Rails: Keep changes to objects/associations in memory without saving to database.

I have a Rails model with various attributes and has_many relationships to other models. In the view I want the user to be able to enter/change values which will change the values in the loaded object and return results calculated from them whenever they make a change. However, I don't want the values to change in the database until th...

Strange PHP that has got me stumped.

I'm looking at this code and thinking I can't see the error because there is somethign wrong but I just can't see it... I'm hoping someone here can see it as staring at it for the last half an hour hasn't made it clear to me. The code: if (!empty($_SESSION['email_notifications'])) { print '<br>SESSION[email_notifications] = ['.$_SE...

Getting current session object in Java

Can I access session object from within a function where request object is not present? I know in Java we access session like this: HttpSession session = request.getSession(true); But what if we want to access session when request object is not present? Is it possible? is there an alternate way to get session object? Edit I ha...

Storing objects in session

I have a PersistenceCapable class @PersistenceCapable(identityType = IdentityType.APPLICATION) public class MyClass { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; .......... .......... } In my servlet, I need to store object of this class in session ............ MyClass u...

How do I allow clients to upload to Amazon S3 without giving out my keys?

One of my clients has a site which displays media that has been uploaded from a client application. This application initially used FTP, but we're moving to S3 for various data storage and performance reasons. What I would like to be able to do is have this client upload a file directly to our central S3 store (ala dropbox/jungledisk e...

PH&Sessions: Is there any way to disable PHP session locking?

Hi. Is there any way to disable the session locking in PHP while using the default session handler? [EDIT:] Or is there at least a way to restart a session after calling session_write_close()? `session_start()' does not work if any output is already sent to the browser. Thanks, Taloncor ...

Login systems: Why are sessions needed?

I was creating a login system with PHP and I wondered: Why are sessions needed? If I store a cookie with the userid and the sessionid doesn't it pose the exact same security risks to storing a cookie with userid and password hash (given that the password hash is strong enough)? Yeah, someone could potentially steal the cookie, but isn't...

Is this true about cookies in PHP?

Is it true that if a script sets a cookie and if the user's browser is set to not accept cookies, then the set cookie function will detect this and instead set a session? ...

selenium rc googlechrome not validating session

Hi, When I try to login to googlechrome to the site http://www.pb.com/addressrightnow through the test script the login never works, chrome browser 5.0 is never able to validate session. But the same works when I manually launch chrome and login. The only difference is I start the selenium server from the test script. The same works per...

I don't want a session to be invalid until the browser is closed

Hi, Storing the session id on the client computer is no problem and is very straight forward. The problem is to store the actual session on the server until I'm actually feeling I'm done with it. The garbage collector is pretty clear about how it works. I can see no way to prevent it from cleaning up the garbage within a certain time. ...

Session::instance() and push array data to session array

for example i have Session::instance()->get('orders') which is an array of some arrays: $first = array('id' = 1, 'name' => 'first', 'price' => 100); $second = array('id' => 2, 'name' => 'second', 'price' => 200); $_SESSION['orders'] = array($first, $second); but if i use this Session::instance()->set('orders', array(array('id' => 3, '...

caching with memcached

I have a section in my main layout like the following. I am starting to use memcached and wondering if this portion can be cached somehow becasue the current_user call makes a hit to the database for every page load and by nature of the plugin (authlogic) thats behind it, it actually updates the user record (i.e. the perishable token). ...

what is crossdomain cookies? are they really useful ? if so when is it used

What is a crossdomain cookie ? what are they meant for ? Can you give some senarios where crossdomain cookies are useful. Would appreciate for in depth explanation. ...

problem with session in codeigniter

hi . i have this code in my controller class Upload_center extends Controller { function __construct() { parent::Controller(); $this->load->model('auth_model') ; if(!$this->auth_model->authorize()) { redirect('login'); } } and i have this code in my view $('#swfu...

Session read write issue when I use curl between two apps

Hi, I have 2 web apps running on the same server. I tested the following on localhost so far, but I am really curious as to whether there was any fundamental issues with this implementation. Let us call these apps Shopping.com and Checkoutshopping.com. When a user on shopping.com clicks on a PayPal button, I will trigger a function; ...

Does fetching current_user require a corresponding view?

In my controller i have an action which does not have a corresponding view. Precisely: the upload action for uploading images. However, i require the current users id to store the image url. But the current_user method always returns nil, as the action by itself does not have a view. In such scenarios how do i fetch the current_user? I a...

How to maintain Multiple concurrent user sessions in a rails application?

How to maintain multiple concurrent user sessions in a web application? I am using restful-authentication plugin for user authentication. when, I opened a new browser n log in as a different user, the session of the previous user is being killed. only one user is able to access my application at a time. Please help me out in solving this...

advantage of db session?

Hi, while I was installing Magento, I saw db storage option. There were 'file system' and 'db'. What is advantage of saving sessions in DB? I can't think of one. ...

Dynamic size two dimensional array

Hi, I'm currently working on a webshop. For that i need to make a two dimensional array to store the items moved to the cart. Cart: Cart = Session("Cart") Items = Session("Items") And when an item is moved to the cart: Items = Items + 1 Cart(1,Items) = Items Cart(2,Items) = rs("id") Cart(3,Items) = Request("attr") Cart(4,Items) = ...