session

Store user information in session?

Should you store info about the user required for each request eg. Role, email, username etc. in Session, or is ok to goto the database each request for this information?? Thanks ...

Should PHP session be created before login or after successful login

If PHP session is created before login, there will be one session file created for each request to login page. The problem is if user makes multiple requests to server through a script then those many session files will be created. If user wants to attack server,he can send abnormally huge number of requests creating so many session fil...

Login a user in joomla from com_jumi (or another external (to joomla) script)

I have to log a user automatically when certain events happens, example when a user forgot his password and reset it successfully. By client requirements a have to use a file embedded in com_jumi to make the login and not com_user. I'm using the function login of JSite object as in: $mainframe->login($credentials, $options) and that met...

How to start a new process in a new window in an existing GNU screen session, from outside the session

I asked a similar question here and got pretty close to what I'm looking for http://stackoverflow.com/questions/1220797/how-to-start-a-process-from-another-application-and-then-open-a-terminal-to-that ...but, this doesn't quite get to what I'm after, which is starting a process in a new window (not an existing window) in an existing sc...

Can I force a rails session to reload from a string?

I have a third-party app (an upload progress bar - swfupload) that I'm using with rails 2.3.3 that cannot pass along session information or cookies. I can, however, pack the session data from my app into the URI it will use to upload a file and retrieve that when I get the file. The trouble is, none of the magic hacks I see floating ar...

ASP.NET sessions

Hi all I am trying to find out in my asp.net application the users that are currently logged in the application by searching on the session info. Currently, I am only able to see my current session, but I cannot find out if there are other users using it. Is there a way to see if there are other users using the applicatin by looking at t...

Logging session duration to a database on asp.net website.

I need to log sessions to database on my asp.net website: who and when started and finished the session. I've configured odbc logging on my iis server but unfortunately there is no such information being logged (or I can't see it). How can I do it either on asp.net website (but simply because there are hundreds of pages and I can't modif...

Wordpress: displaying an error message - hook admin_notices fails on wp_insert_post_data or publish_post

I'm adding validation so if a post is in a particular category, it needs certain Custom Fields to be set. This should be easy hooking wp_insert_post_data and admin_notices, but there is a redirect that causes the admin_notices callback to disappear. OK - So I created a hack that uses the Session to store my error message across the red...

Command to clear the cookie-based session store in Rails.

I often want to clear the session store in Rails, in particular, the default cookie-based session store. Some sites seem to suggest that rake tmp:sessions:clear accomplishes this task, but it appears that it does not. What is the proper way to clear the cookie-based session store? ...

php sessions to authenticate user on login form

I have the following code designed to begin a session and store username/password data, and if nothing is submitted, or no session data stored, redirect to a fail page. session_start(); if(isset($_POST['username']) || isset($_POST['password'])) { $username = $_POST['username']; $password = $_POST['password']; $_SESSION['user...

How long can/should an NHibernate session be kept open?

Hi, I've created a windows service which is listening to a MSMQ. For each message I receive, some DB transactions need to be made. Later it might be possible that there will be 1 message every second. Currently the Nhib session is kept open until the service is stopped manually. Is it a good practice or should I close the session after ...

ASP.Net use of documents

I have a problem in my asp.net application. The users can access a document, but only one user can access one document at the same time. When a user gets a document, a flag in the db is updated for the document, indicating that the document is in use. When the user finnishes working with the document, this flag is updated again to indica...

How can I send PHPSESSID in the URL?

Hello folks, I'm trying to send the PHPSESSID via a HTTP GET variable for a cookie-less client. I've seen this in various drupal implementations where ?PHPSESSIONID=123ABC is appending to each link, but how do I specify this in PHP and is there any way of changing the GET parameter so it could be ?token=123ABC, or even sent via HTTP PO...

Weird behaviour of Zend_Session_Namespace

Follow up to this: http://stackoverflow.com/questions/795414/why-cant-i-pass-user-sessions-between-subdomains I followed the advice there and used : ini_set('session.cookie_domain','mydomain'); (with and without a dot before mydomain) as the first line of index.php in the public folder as advised there and in other links around the we...

How can I avoid PHP session errors?

Occassionaly I run accross this error in PHP, how can I fix this or what cause it? Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disab...

JSF - Richfaces - How to know if the session is timed out (on client)

I am developing application using JSF- richfaces. The application has standard login page, session management and the session expire time is 15 min. One of the requirement is, when the session expires and if the user clicks on any of the links, I need to display a popup(instead of going to login page) which will say "Your session expir...

Redirect to previous page in zend framework

Hi there, I want to add a redirection URL to my login forms action (as a query) in login page, so after loging-in, one can visit the previous page he or she was surfing. First I thought about using Zend Session and save the url of each page in a variable. but I read in the documentation that it has overhead. So, is there a better way t...

How to avoid deprecation warning by replacing session_unregister with $SESSION[]?

I just installed PHP 5.3 and am weeding out consequent "deprecated" warnings. It says session_unregister() is deprecated in: session_unregister($serverWideUniqueIdCode); and the replacement seems to be $_SESSION[]. So what would be the syntax with $_SESSION[] to express the same thing? ...

PostBack and session values. Why after button is clicked and session created postback still show null

protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lblPostBack.Text = " Text created first time"; } else { if (Session["Counter"] == null) { lblPostBack.Text = "PostBack x however strange becasue if is postback it's mean somebody clicked button and session va...

What's a good FOSS java servlet session replication solution

I work on a very high volume public website running on Tomcat 5.5. Currently we require stickiness to a particular server in order to maintain session. I'd like to start replicating session, but have had trouble finding a good FOSS solution. I've written my own Manager (using memcached as the store) but am having trouble dealing with ...