Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [nonce]

The tag has no usage guidance.

6
votes
1answer
1k views

Extend Wordpress (4.x) session and nonce

We've got a small web application that allows users to log in (via WordPress) and remain logged in for a max 15 min session for security purposes. Because most sessions will last longer, I have a ...
4
votes
1answer
2k views

WordPress failure when logging out

I have came across the WordPress logout error several times but I really never figured out the cause of it. In earlier days, it was generally that I was missing a nonce but now even with logout link ...
3
votes
1answer
2k views

Getting “The link you followed has expired” when adding custom post [closed]

EDIT: I have completely rewritten this question because it has been closed as off-topic. In my opinion, it has two very relevant points that could help other developers but, in its original form, ...
10
votes
2answers
1k views

Are Nonces Useless?

This is probably a noob question BUT hear me out - isn't the point of using Nonce to protect from things like scrappers (phpcurl scrappers etc.)? But my Nonce prints out in the head of the document ...
4
votes
1answer
511 views

Do I require the use of nonce?

Im creating a visit/page views counter with ajax,jquery and php, I have been reading a few articles that recommend the use of nonces for data manipulation through ajax, however i am not sure if i need ...
15
votes
4answers
6k views

Do I need a nonce field for every meta box I add to my custom post type admin?

I'm currently working on the admin page of my custom post type, and I got stuck on deciding whether to add a nonce field again for the second metabox or not. I'm very new to custom post types, and ...
20
votes
2answers
7k views

wp_verify_nonce vs check_admin_referer

What is the difference, which one should I use? I know that wp_verify_nonce checks the time limit, and check_admin_referer I think calls wp_verify_nonce as well as checking for an admin url segment, ...
2
votes
0answers
2k views

Security - Ajax and Nonce use [closed]

I'm developing a site which posts a number of ajax calls from jquery to PHP and returns data from PhP to jquery. Everything is working, but i'd to know if my approach to handling the calls is ok, in ...
5
votes
4answers
10k views

How to use nonce with front end submission form?

Thanks to a variety of posts on here I've managed to put together a front end submission form. After about 24 hours of tweaking I've finally got everything working including a redirect to a 'success' ...
12
votes
1answer
3k views

How does nonce verification work?

I can see that wp_nonce_field generates a value in the hidden field. <input type="hidden" id="message-send" name="message-send" value="cabfd9e42d" /> But wp_verify_nonce isn't using that ...
8
votes
3answers
3k views

Nonce retrieved from the REST API is invalid and different from nonce generated in wp_localize_script

For those that arrive from Google: You probably shouldn't get the nonces from the REST API, unless you really know what you're doing. Cookie-based authentication with the REST API is only meant for ...
5
votes
1answer
4k views

How to expire a nonce?

I am aware of the fact that we can alter nonce life time using filter , 30 seconds here: add_filter( 'nonce_life', function () { return 30; } ); I have a logout() function for my rest api .I wish to ...
3
votes
1answer
713 views

Using nonce external of WP Admin

All, I've got two wordpress pages. One wordpress page displays a form to do some registration stuff for the website. The second wordpress page actually processes the data and inserts it into a custom ...
2
votes
1answer
455 views

Security around save_post hook

There are a lot of examples using the save_post hook, that include adding and verifying a nonce, and checking the user has appropriate permissions before you continue. Is this necessary? When ...
1
vote
2answers
2k views

Ajax function returns -1

I have a question. I made a simply ajax function. When I'm logged in, it works perfectly. When I'm logged out, it returns me -1 (since Wordpress 3.1) Why ? I don't understand. Precisely, it returns -...
1
vote
2answers
4k views

Undefined index: at_nonce in custom post metabox

I'm getting this error with my custom post metabox. The custom post and metabox works fine, but if i have debug on and when i try to save any other page or post, i will get an error: Notice: ...
1
vote
1answer
2k views

Handling nonce generation in AJAX registration process

I am currently working on a multi-steps registration system, based on the new Wordpress Rest API and I got an issue related to the nonce generation and verifying. My first step is to ask the user ...
0
votes
1answer
2k views

“Notice: Undefined index:” error when adding new content?

I'm getting the following error... Notice: Undefined index: album_tracks_metabox_nonce in /Applications/MAMP/htdocs/TheToasters/wp-content/themes/Toasters/discography-post-type.php on line 124 ......
0
votes
1answer
3k views

WP REST API: check if user is logged in

The idea is to show or hide some sections of the site in a theme that's fetching all data from the REST API, using AngularJS. I thought this check would help me (nonce is passed as header, as ...