Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts

    How to verify using Greesemonkey script if user is logged in


    Good day all coders..
    I will be grateful if anyone there can help me with a solution.

    What I am trying to achieve.
    I have a personalized greesemonkey userscript that I want to offer to our site users. The script works on all websites.
    Now, I want the script to verify if the user is logged in to our site or not.
    The script should be effective only when the user is logged in.

    This has become a privacy concern for us, and its required to prevent from free distribution of the script.

    Is there any simple way to achieve?

  • #2
    New Coder
    Join Date
    Jun 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Well,
    I have made some progress, at least I am experimenting with some ideas.
    But as a beginner still I would appreciate some help..
    The userscript (widget) will have to read cookies to determine if the user is logged in.

    For example, my website is example.com
    When a user is logged on, example.com creates a cookie named 'PHPSESSID'
    which expires when user is logged out.
    While the cookie is active our userscript (widget) which is a greesemonkey script will remain active.

    Now, guess a user is browsing codingforums.com with our widget showing at the bottom.. whats the code to read the cookie 'PHPSESSID' that was set by example.com?

    Any input?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •