Questions tagged [sessions]
Use it for questions about the session system, which handles recognizing users from a session cookie.
234
questions
17
votes
2
answers
26k
views
Understanding Drupal's session management and user authentication
I have a requirement to replace the default user authentication with the authentication of a central server, i.e., the SSO server.
By debugging Drupal, I learned that all the session management ...
1
vote
1
answer
359
views
Is it possible to access the `session` table using db_query/db_update/db_insert?
is there a security feature that is preventing me from doing anything with sessions?
I'm pretty sure this is a bad idea, but I'm switching users around after login.
User A logins in using their ...
1
vote
1
answer
2k
views
User session and https
I've got a few pages on my site that need to be accessed via https.
I need to pull some information about the current logged user on those pages.
The problem is, users log using http mode and the ...
1
vote
1
answer
121
views
What will happen if I restore backup DB with empty session table?
It seems that only the session is really big compared with other tables.
Is there any bad effect to Drupal site if I restore my backup Mysql file after deleting all the rows in session table?
5
votes
2
answers
4k
views
using drupal sessions during hook_boot
When a user calls the front page of our site we want to check the country from which the user is surfing and redirect the user directly to the country specific front page.
We chose to use the ...
2
votes
3
answers
596
views
How to gets analyts and generate visual reports from sessions?
I'm looking for a technique or approach to get data from user session logs and convert it to a some sort of visual style (bars/charts/whatever).
We'd like to specifically have the users session "arcs"...
0
votes
2
answers
219
views
Equivalent of OnSessionStart for drupal
I am looking for the equivalent or at least a way to run a snippet of code only when the session starts and at now other time do i want this code run. Can anyone help me with this? Ive looked around ...
0
votes
2
answers
1k
views
Caching $_SESSION data for anonymous users
I recently inherited a Drupal 6 website that is using $_SESSION to store a lot of anonymous user data. Currently none of this $_SESSION data can be accessed while caching is enabled.
I have ...
0
votes
1
answer
629
views
User 1 becomes anonymous on node/add, access denied messages
I had been developing a Drupal site locally and put it up online recently without much problems. Our server runs in PHP Safe Mode, but I've already got most of the website working nicely. The only ...
2
votes
1
answer
2k
views
How to unserialize D7 session?
This is how the user session is stored in Drupal 7:
batches|a:46:{i:13;b:1;i:14;b:1;i:15;b:1;i:16;b:1;i:17;b:1;i:18;b:1;i:19;b:1;i:20;b:1;i:21;b:1;i:22;b:1;i:23;b:1;i:24;b:1;i:25;b:1;i:26;b:1;i:27;b:...
0
votes
2
answers
784
views
Where to initialize module specific variables
I have been using hook_init in order to initialize some _SESSION variables on my application, however a problem I got after... is that hook_init is called on every ajax request. That's why I wanted to ...
4
votes
1
answer
1k
views
Regular session table crashes, on a large multi domain, multi site Drupal set-up
I have recently been assigned to a project that has regular session table crashes.
Drupal outputs an error like this one:
"Warning: Table './[database]/sessions' is marked as crashed and should be ...
3
votes
2
answers
1k
views
Website saves separate sessions for "www.domain.com" and "domain.com"
I open a browser, type "www(dot)mydomain(dot)com"
I login as an admin
I open a new tab, type "mydomain(dot)com". I'm logged out, and i can login as a different user..
It's weird. I can't find ...
1
vote
1
answer
11k
views
How to read the session cookie with javascript?
I'm trying to detect with javascript if a user is logged in.
For some reason the drupal session cookie is not showing up when I use
alert(document.cookie);
It does show "Drupal.tableDrag.showWeight=...
1
vote
1
answer
576
views
How do I transfer anonymous data the user when he registers?
I have a system for storing data (e.g. accessibility settings like colour contrast) for anonymous and authenticated users. Authenticated users have the data in a dedicated table.
For anonymous users ...
0
votes
1
answer
670
views
Tracking Sessions and Calling a web service
I have a module that simply has a couple functions that retrieve cookie information, set cookie information and calls a web service using the web service client to help track the users information. ...
4
votes
1
answer
6k
views
$_SESSION vars created outside of Drupal lost when navigating to a Drupal served page
I'm building a Facebook iframe app in Drupal.
I'm using an initial simple PHP script (non-Drupal driven) to handle the Facebook open auth side of things - this script is getting the Facebook user's ...
0
votes
1
answer
5k
views
Trouble with session ID and Drupal cookies when trying to establish a connection with Service Module and http-post
I am trying to complete an http-post between my common lisp application and my Drupal Site running Services and a Rest server. Currently I have my rest server set up to accept user login, and using ...
18
votes
4
answers
14k
views
How to logout all active users?
Instead of putting my site in "maintenance mode" I would like to put it in a complete "readonly mode". There is a module for that, however, it only prevents "node add and edit".
I would like to ...
0
votes
3
answers
576
views
Visit counter for anonymous visits?
I would like to keep track of the number of visits for each anonymous user. I want to be able to show special messages, for example when they visit the site the 10th time.
Incrementing a cookie ...
0
votes
1
answer
864
views
Session values are getting populated only when the page is refreshed
I have a webform. I provide default values to these webform using session token variables. These session variables are set using hook_form_alter(). The problem is that when users log in, and see the ...
3
votes
2
answers
820
views
Logging out issue
How can i prevent users who have logged out from accessing their account when they try to access their account by clicking the browser previous-page button?
Currently, users can access their ...
1
vote
2
answers
392
views
What is the equivalent of sess_count in Drupal 7
As Converting 6.x modules to 7.x explained:
All session functions starting with sess_*, as well as session_save_session(), are now renamed to drupal_session_* or _drupal_session_*
I have to use ...
1
vote
2
answers
2k
views
Language information in Session for anonymous users
I selected the language preference to be detected with user sessions, the problem is that for anonymous user this preference does not seem to be stored. As this site is not user driven (Meaning that ...
0
votes
1
answer
157
views
Getting 'bool(false)' output before normal page HTML
I've seen this happen once or twice before, but can't remember where or why.
Basically, in one of my page's HTML output, the first line of HTML is returned as 'bool(false)' - On that particular page, ...
4
votes
2
answers
1k
views
22762 rows in my session table. What does this mean for the site, and what should I do about it?
Ok so the title is pretty self explanatory. There's thousands of rows in the session table. I see that the Persistent Login module is enabled. I don't know if this affects how the sessions are stored. ...
4
votes
2
answers
4k
views
How should I share sessions transparently across domains?
I work on a Drupal site which has multiple domains (not sub-domains) using Domain Access to set different themes, display different content, etc. on each of them. These multiple domains are used for ...
0
votes
5
answers
916
views
Problems with logging out users
I was running through some tests on my site with a client, and I was logged in as a normal authenticated user. I then logged out with the intention of logging back in as the superadmin (uid -> 1).
I ...
10
votes
5
answers
5k
views
Why are my $messages delayed one page refresh?
I have a page with a very simple template:
<!DOCTYPE html>
<html>
<head><title>TEST REGISTRATION PAGE</title></head>
<body>
<?php
print ...
0
votes
1
answer
2k
views
$_SESSION empty
I'm printing error messages (e.g. from the login form) in my page with <?php print $messages; ?>. Nothing is showing up.
I think my problem is that the $_SESSION variable (which should contain ...
1
vote
2
answers
333
views
Best way for implement 'Site Gate'
I try to add 'site gate' to http://bartenderlab.it.
It's alcohol content so people under 18 are not allowed to view this site.
I created module with hook_init:
function gate_init() {
$curr_uri ...
20
votes
5
answers
18k
views
How do I save session data for the anonymous users?
In my last project for Drupal 6, I did save the data using code similar to the following one:
$_SESSION['xxx'] = serialize($data);
In Drupal 7, it doesn't work.
How should I save the session data ...
14
votes
2
answers
34k
views
How to set and retrieve cookies?
After several days and more hours I only found issues and patches about what to do once a cookie is set, but not one is mentioning how you get a cookie set in the first place.
Our intention would be ...
6
votes
4
answers
4k
views
Does user_is_logged_in() check if there is at least one user logged in?
Does the user_is_logged_in() method return TRUE if there is at least one user logged in? Or does it refer to the current session, and returns TRUE if the current user is logged in?