08-11-2004
I am fiddling around with variations of this now.... However, I have a set of columns in the users table that govern various permissions over the DB, (e.g. can create categories, can edit items, can delete items, etc, etc). So I can't really break it down into either admin or users, as I want to assign each user fine grained permissions - this is what makes setting the cookie (and then getting the page to render accordingly) quite difficult. As you say, if you login as somebody else the cookie gets clobbered and the "old" session assumes the values stored in the "new" sessions cookie.
It also becomes complicated when reading in cookie values. Say i'm logged in as both a user and an admin, and I try to remove an entry as the user, if the admin cookie exists as well, isn't it going to be a pain to decipher what's going on? (Because the script will be saying "if admin cookie exists - allow, else disallow), but both cookies will exist?
I think as a workaround for now, I will have to stick to limiting the thing to a single session per IP address. It's kludgy but will work. I think that it's just as easy to log out, and then log back in as a user with appropriate priveledges to do whatever needs doing. I've also set up a series of cookies that are set to various crypt()ed values to stop a user trying to forge a cookie with elevated priveledges and everything seems pretty secure at the moment.
Let me know if you come up with anything more (or if I've got the wrong end of the stick) - I'm still open to ideas and am still hacking around.
Thanks again,
Cheers
ZB
10 More Discussions You Might Find Interesting
1. Solaris
Any idea as to how multiple loggin sessions by the same user (using Hyper terminal/Telnet) be restricted in Sun Solaris 8.
Rgds
Naushi (10 Replies)
Discussion started by: Naushi
10 Replies
2. Shell Programming and Scripting
I have a program which gets an input file (which contain a list of objects) and processes the objects one by one sequentially. However when there are many objects it is faster to split the input into smaller lists and run the program in multiple terminal sessions simultaneously. I want to know if... (2 Replies)
Discussion started by: stevefox
2 Replies
3. UNIX for Advanced & Expert Users
Just a quick question,
Can I establish Multiple Sessions between two machines using FTAM?
Regards,
Gaurav Goel (0 Replies)
Discussion started by: gauravgoel
0 Replies
4. UNIX for Dummies Questions & Answers
;)Hi Everyone,
I am using solaris 5.10.
I have a java process running in server mode in unix.
The problem is that it automatically forks i.e creates a child process.
I mean suddenly two instances of that process start running , in which the process-id of first instance is the parent... (0 Replies)
Discussion started by: glamo_2312
0 Replies
5. UNIX for Advanced & Expert Users
Hi Everyone,
I am using solaris 5.10.
I have a java process running in server mode in unix.
The problem is that it automatically forks i.e creates a child process.
I mean suddenly two instances of that process start running , in which the process-id of first instance is the parent... (5 Replies)
Discussion started by: glamo_2312
5 Replies
6. Shell Programming and Scripting
I need to install a tomcat6 with multiple instances like instance1,instance2 and instance3 in a server.
I came to know that for that we need to install tomcat6,apache2.0,mod_jk1.2 and jre with tools.jar installed.And we need to create multiple instances with same web.xml and difference... (0 Replies)
Discussion started by: tuxslonik
0 Replies
7. AIX
Hi.
I installed xming to access to my servers but I have a problem : i can only have one session at a time ... i don't find any parameter to change this.
Tks (3 Replies)
Discussion started by: stephnane
3 Replies
8. Red Hat
Hi,
I use OpenSSH to log on to a RH server but when I enter the password 2 session windows appear.
I only need one so can anyone advise where I can rectify this?
R,
D. (2 Replies)
Discussion started by: Duffs22
2 Replies
9. Shell Programming and Scripting
I wish to be able to pass PHP values between multiple scripts. In each script, I have the following before any HTML code:
<?php
session_start();
session_name("STORE");
session_set_cookie_params( 'lifetime', '/var/www' );
session_id('Gingy');
... (1 Reply)
Discussion started by: Meow613
1 Replies
10. UNIX and Linux Applications
Hello.
I plan to use mysql with only instance database so I can stop one database for maintenance without stopping every thing.
When one reads through the my.cnf config file, it is not clear if we must use at the same time a single database mysql plus any instances mysqld2 (for app1), mysqld3... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT DEBIAN
mojolicious::sessions
Mojolicious::Sessions(3pm) User Contributed Perl Documentation Mojolicious::Sessions(3pm)
NAME
Mojolicious::Sessions - Signed cookie based sessions
SYNOPSIS
use Mojolicious::Sessions;
my $sessions = Mojolicious::Sessions->new;
DESCRIPTION
Mojolicious::Sessions is a very simple signed cookie based session implementation. All data gets serialized with Mojo::JSON and stored on
the client-side, but is protected from unwanted changes with a signature.
ATTRIBUTES
Mojolicious::Sessions implements the following attributes.
"cookie_domain"
my $domain = $session->cookie_domain;
$session = $session->cookie_domain('.example.com');
Domain for session cookie, not defined by default.
"cookie_name"
my $name = $session->cookie_name;
$session = $session->cookie_name('session');
Name of the signed cookie used to store session data, defaults to "mojolicious".
"cookie_path"
my $path = $session->cookie_path;
$session = $session->cookie_path('/foo');
Path for session cookie, defaults to "/".
"default_expiration"
my $time = $session->default_expiration;
$session = $session->default_expiration(3600);
Time for the session to expire in seconds from now, defaults to 3600. The expiration timeout gets refreshed for every request. Setting the
value to 0 will allow sessions to persist until the browser window is closed, this can have security implications though. For more control
you can also use the "expires" session value to set the expiration date to a specific time in epoch seconds.
# Expire a week from now
$c->session(expires => time + 604800);
# Expire a long long time ago
$c->session(expires => 1);
"secure"
my $secure = $session->secure;
$session = $session->secure(1);
Set the secure flag on all session cookies, so that browsers send them only over HTTPS connections.
METHODS
Mojolicious::Sessions inherits all methods from Mojo::Base and implements the following ones.
"load"
$session->load(Mojolicious::Controller->new);
Load session data from signed cookie.
"store"
$session->store(Mojolicious::Controller->new);
Store session data in signed cookie.
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojolicious::Sessions(3pm)