Session ID's

Discuss general development subjects that are not specific to a particular version like the versioning control system we use or other infrastructure.
Locked
puck54
Registered User
Posts: 1
Joined: Tue Mar 24, 2015 11:12 pm

Session ID's

Post by puck54 » Tue Mar 24, 2015 11:29 pm

I have a completely anonymous forum, and need to track certain transactions by Session ID. For example, I've added a like button to each post. The like button was developed with logged in users in mind, it tracks when a user clicks on the like button and records it to a database with UserID & Post ID so the user cant continuously click the like button. I've been able to separate when a "guest" click the log button and want to record the session_ID & PostID so that they cant continue to click the like button as well. Here's my questions...


1) Is my thinking about the persistence of the Session id correct. It stays the same until 5 minutes of in-activity.

2) I cant seem to find a variable with the guests session ID in it? I've tried
$this->user->data['session_id']
$this->user->'session_id'
$session_id
and many others...

and here's the line I'm trying to insert the session_id into the database.

Code: Select all

$sql = 'INSERT INTO ' . $this->table_prefix . 'posts_likes (post_id, user_id, type, timestamp, session_id) VALUES (' . $post . ', ' . $this->user->data['user_id'] . ', \'post\', ' . time() . ',' . $user->session_id . ')';
Here's a link to the full code I'm modifying...
https://github.com/satanasov/postlove/b ... jaxify.php

Any help is appreciated.

Thanks :)

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1731
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Session ID's

Post by DavidIQ » Wed Mar 25, 2015 1:46 pm

Hello,

This is not the proper location for this query as we have no knowledge of this extension so we cannot provide any support for it. You need to contact the extension author about this. You can do so through github or through the corresponding development topic in our [3.1.x]Extensions in development forum, if one exists. Extension development queries can be made in the [3.1.x]Extension writers discussion forum.

Thanks.
Image

Locked