Questions tagged [sessions]

Use it for questions about the session system, which handles recognizing users from a session cookie.

Filter by
Sorted by
Tagged with
7 votes
2 answers
12k views

How to get an anonymous user session id?

I am writing a chat module where anonymous users are able to chat with a logged in user via an external websockets connection. I need an ID to uniquely distinguish the anonymous users and assign them ...
drcelus's user avatar
  • 1,652
2 votes
1 answer
437 views

Twitter sign in module session token values lost in twitter/oauth path in HTTPS - Invalid Twitter OAuth request

The twitter sign in module works on my local and staging server on HTTP fine. But when I install the same module in production mode which is https://example.com, it stops working. The error says "...
user32200's user avatar
0 votes
1 answer
397 views

Can't get the authenticated user cookie session to be used when creating a new node via Services 3 endpoint

My application is sending this header to Service 3 endpoint when creating a new node: { 'Cookie': 'SESS255f42d9a87a0df5bf8959d25909fe8c=St8o29NI9Hx84kPo8NuZbpdHWuRgNSS9qy9cQ-QM4rA; expires=Sun, 15-...
Francisco Luz's user avatar
1 vote
1 answer
197 views

Why do site visitors end up with two sessions after logging in?

I have an up and running Drupal 6.30 (latest) site, but some users are having problems logging in. This is due to the user having two rows in the sessions table, one for uid 0 and one for their uid (...
Craig's user avatar
  • 151
0 votes
1 answer
373 views

Login with iframe popup

I have popup showing on click on a link on my site which shows a login form in iframe. i am able to login with popup iframe but when i close that popup, i am not logged in on main site and need to ...
Vikram's user avatar
  • 364
1 vote
0 answers
347 views

Autologout on browser close [closed]

I need to log out users when the browser session is closed and users are visiting a Drupal 7 site. I tried to modify the lines on the settings.php which calls ini_set() for session values, but it ...
Cris's user avatar
  • 229
0 votes
1 answer
539 views

Efficient way to keep Drupal 7 session alive from another web app?

Is there a simple PHP file I could create which, when called by an authenticated user, will keep their Drupal session alive? I don't want to do an AJAX call to /index.php as this will cause ...
Darren's user avatar
  • 293
3 votes
2 answers
7k views

Session variables on custom modules

I have two modules. The first module is for custom login form and the other is for custom user pages. I want to store a session variable from the first module and later to call on the second module. ...
user2519032's user avatar
0 votes
1 answer
4k views

How do I access Session variables in Drupal that were set on non-drupal pages?

If I go print_r($_SESSION) on a drupal page (say mysite.com/ )I only get Session variables set from drupal pages (which are none atm). I can set new ones and they'll show up. Array ( ) However If ...
Jiminy Cricket's user avatar
3 votes
1 answer
3k views

Sessions Table Getting Huge

Currently, my sessions table is 1.6gb with 3,956,161 total rows. I think the sessions does not expired. I have a default settings in my settings.php as follows: ini_set('arg_separator.output', '&...
jaypabs's user avatar
  • 655
1 vote
3 answers
583 views

How to detect which module creates session?

I am trying to achive Varnish HIT for anonymous user but get only MISSes. It seems that my Drupal 7 site somehow starts new session for every anonymous user which opens even main page of the site. I ...
Val Budkin's user avatar
0 votes
2 answers
931 views

How can I grant permissions to anonymous users per session to download a file?

Anon users can fill out and submit a form (webform). As soon as submitted, the user will be offered to download a pdf file with his entered form data. How can I manage this? With sessions?
Alex's user avatar
  • 2,493
0 votes
2 answers
2k views

How to properly recognize a session id generated by drupal?

I'm storing stuff in a session that is sometimes handled by drupal. The session id is passed forward to another service, which checks back to the original server to get the session data. When the ...
commonpike's user avatar
4 votes
2 answers
8k views

Session Timeout after certain period of inactivity

How can I logout users after a certain period of inactivity (say 20 minutes)?
user24393's user avatar
0 votes
1 answer
41 views

Content disappeared for authenticated users

Suddenly, I have encountered a weird problem. I see my site flawlessly as admin and unauthenticated users. But all the timestamp-based content (Like blocks-forum thread etc.) disappear when I log in ...
Levox's user avatar
  • 298
1 vote
3 answers
2k views

Access denied for admin user after new drupal 6 install [closed]

I just installed Drupal 6 (Don't ask why) from a fresh install (Version 6.29). I followed the install steps, created an admin user, set the correct time zone, etc. But when I login and attempt to ...
Andrew's user avatar
  • 111
1 vote
2 answers
746 views

Unusual behavior of Shopping Cart (Drupal Commerce)

I am using Drupal Commerce for a portal & I am facing a issue which is re-producible on fresh instance as well. Suppose if I have a account on a website and I am logged in. I add some items to my ...
RajeevK's user avatar
  • 3,129
2 votes
1 answer
519 views

Multipage Registration form, Confirmation Page Security Issues?

I have a multipage registration form working on a site, but the confirmation page is supposed to show some of the information (account name and other data) after the account has been submitted/created....
Jon Paul Vivere's user avatar
1 vote
0 answers
69 views

Why are there many session entries for anonymous users in my sessions table?

I checked the session table and it was getting huge. Most entries are the anonymous users. Does Drupal make sessions for anonymous users, or only on error pages?
awm's user avatar
  • 2,429
2 votes
2 answers
2k views

What would cause a duplicate session key?

I occationally recieve the following error resulting in failure of several pieces of code later in the pipeline. PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '...
danielson317's user avatar
1 vote
0 answers
371 views

Is it possible to trace a Drupal PHP session variable and if so, how?

I'm having an issue with Drupal not caching pages and I think it's being caused by an active PHP session variable being set for anonymous users. I want to know if it's possible to quickly and/or ...
Jamie Hollern's user avatar
1 vote
3 answers
2k views

"Cannot modify header information - headers already sent by (output started at codefolder\modules\user\user.module:1)"

i am using drupal 6, mysql 5.5 on apache 2.2 it is working fine. but when i migrated my code on xampp1.7.3(contain apache2.2 and mysql 5.5). it gives issue and error. warning: Cannot modify header ...
Sanjay dev's user avatar
0 votes
2 answers
902 views

Using Drupal's session inside a PHP script [duplicate]

I need to pass parameters from a Drupal page to a PHP script. There's no way to pass that directly and I need to use SESSIONS. I've searched around and added this at the top of the script: define('...
doron's user avatar
  • 427
4 votes
1 answer
1k views

Additional Configuration to disable anonymous session cookies?

I am running a clean install of Pressflow 6.28. I have set the following configurations: Cache Mode: Normal; Min Cache Lifetime: 5 minutes; Page Cache Max Age: 1 day; I have installed no contributed ...
andrewjm's user avatar
1 vote
1 answer
799 views

Drupal 7 - Destroying the session when the browser closes is not working on Chrome [closed]

Is there an issue with destroying the user session using Chrome? I've set this setting in settings.php: ini_set('session.cookie_lifetime', 0) but it seems like Chrome ignores it or is it just caching ...
Joe Micallef's user avatar
3 votes
1 answer
1k views

Is it possible to set Cookie Session ID from a REST Service?

I have overridden Drupal's login process by calling a REST API which returns a 'true' or a 'false' depending on whether the login was successful or not. Once successful, I'm logging the user in by ...
Joe Micallef's user avatar
2 votes
1 answer
524 views

Storing objects of custom type in $_SESSION - legal way?

I'm trying to figure out: can I load custom class (defined in module) to be loaded before session starts and its contents processed by PHP (unserialized) - is where any legal way to do this? (without ...
Roman Bulgakov's user avatar
0 votes
2 answers
4k views

Persistent session cookies: remember session even after closing the browser

I would like to store anonymous users $_SESSION in a cookie so that their cart and other custom information is still available even after closing the browser. I found this interesting post which ...
ErikaW's user avatar
  • 130
0 votes
1 answer
57 views

Accessing user input

My question is basically how to access values that the user entered in previous forms. For example, I am using drupal commerce and as the user sees a product, fills some text field values and clicks ...
user1479847's user avatar
0 votes
0 answers
79 views

Admin gets logged out when looking at user profile

Every time I log in as admin and view a user profile, Drupal treats me as that user. This is beneficial. However, in order to return to the admin panel I need to log out of that user account and log ...
kevinaskevin's user avatar
1 vote
4 answers
1k views

Can't access global user object after drupal_bootstrap

I have a stand-alone php script with the following lines at the beginning: define('DRUPAL_ROOT', '../../../../../'); require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(...
Cameron Ball's user avatar
1 vote
0 answers
628 views

How can i control session limit module?

I am using Session Limit module for restrict user to login into site from multiple browsers at a time.But here i am facing a problem is if user close the browser with out logout,then the session will ...
Pradeep K's user avatar
0 votes
1 answer
155 views

Drupal and Session Limit

I am using Drupal 6 with the Open Atrium distribution. Is there a problem if the same user connects from more than 100 different computers at the same time? At the moment I am unable to do a test but ...
raz3r's user avatar
  • 73
2 votes
1 answer
203 views

Is there any clean way to have the Drupal login form create a session for phpBB also?

I've made my peace with having two DB's and two sets of roles, permissions, etc. But I'd like to have just one login. Is there a simple way to have the Drupal login throw a session cookie for phpBB ...
Christopher Perry's user avatar
5 votes
1 answer
6k views

Session Timeout module [closed]

What's the best module for a session timeout? I simply want users to be automatically timed out after a period of inactivity. The Automated Logout module looked like it could to the trick, but it ...
DatsunBing's user avatar
1 vote
1 answer
2k views

How can I share session variables across sites? [closed]

On my main Drupal site, users need to be able to select a display preference (e.g. 'high visibility'). This will be available to registered and anonymous users but only for their session, so I plan to ...
pushka's user avatar
  • 1,853
1 vote
1 answer
3k views

store session variable and access it through javascript?

In drupal, how do you store/read session variables? Also, how can i access a stored session variable through javascript? I'm trying to store whether if a user has closed my modal or not so it doesn'...
chrisjlee's user avatar
  • 6,540
0 votes
1 answer
636 views

How to setup session sharing for language subdomains (URL language detection set to domain prefix)

I would like to use domain prefix for language selection, like en.example.com and de.example.com. I've set up language detection to Domain here admin/config/regional/language/configure/url. In theory ...
SiliconMind's user avatar
  • 3,151
1 vote
1 answer
5k views

Post AJAX JSON with session id

Using Drupal Services I am able to log in but each time I post a node it posts as anonymous. I get the session id and session name upon login but can´t pass it along with a POST no matter what i try. ...
MDDY's user avatar
  • 23
0 votes
1 answer
183 views

Store anonymous user selection temporarily until registration

I want to let my first time visitors to first select a city, which will control what they see in my site, so it should be stored where I can see it everywhere (views, search and when posting content) ...
Bassel Alkhateeb's user avatar
3 votes
1 answer
257 views

Are there any security concerns with getting the UID by simply querying the sessions table against the visitor's cookie?

In the High Performance JavaScript Callback Handler I'm attempting to use my own code to get the current user's ID. To give a quick rundown, by returning data at a much lower bootstrap level (...
Charlie Schliesser's user avatar
2 votes
0 answers
1k views

Storing variables in sessions not working

Here is my Custom code I am placing in views custom php field, Strange enough the variables are not storing in sessions except the last session variable, this is strange. drupal_session_start(); $...
Flash Alexander's user avatar
0 votes
1 answer
55 views

Change the current loggedin Domain?

At D7 multi-domain site, how to simply change the current domain of the user after he logged in to another domain? For e.g, A user fill the login form at, "false.example.com", I want to push him ...
夏期劇場's user avatar
0 votes
1 answer
1k views

COOKIE['session_api_session'] not working in drupal 7

I have a simple module to use the flag module base on the session api. This was working in drupal 6 (and another section working for logged in users), i changed the syntax for drupal 7 (remove ...
petergus's user avatar
  • 702
0 votes
0 answers
297 views

Problem with session

I am working in Drupal and Magento Integration Whenever i try to get session data using this code require_once $_SERVER['DOCUMENT_ROOT'] . "/mage1/app/Mage.php"; umask(0); Mage::app("default"); ...
zamil's user avatar
  • 175
0 votes
0 answers
796 views

My $_SESSION array in drupal 7 is empty after login

I tried to view the $_SESSION and $_COOKIE details by print_r ing those two arrays But my session array is empty before and after login. I wrote the code in template.php file. But the user is ...
zamil's user avatar
  • 175
0 votes
0 answers
54 views

After editing .htacess for redirect some users started get the validation error on node creation page. What do I need to do?

I put the following code in my .htaccess to redirect the URL with www to the one without. # To redirect all users to access the site WITH the 'www.' prefix, # (http://www.example.com/... will ...
chinita7's user avatar
  • 1,021
6 votes
1 answer
2k views

Looking for a hook called before any session is created

I am using Drupal 7 and am looking for a hook which is called before any session is created. According to the the API page, hook_boot() is called after DRUPAL_BOOTSTRAP_SESSION. The link is for ...
rexposadas's user avatar
0 votes
2 answers
110 views

Node or static page generation

I am currently working on a project where I have 2 databases: the internal site database, and an external database that contains a table with establishment information I want to display as pages on my ...
wishIknew's user avatar
2 votes
1 answer
2k views

Session variables and page cache

My drupal site uses normal cache system, as you'll probably know, the cache_page table is updated using as primary key the REQUEST_URI. This is great because when an anonymous user requests a page, ...
savioret's user avatar